3
Good afternoon,
How do I make the connection to the Sqlite BD? I made the connection class like this.
package model;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Conexao {
public static void main( String args[] ) {
// Variáveis
Connection con = null;
String driver = "org.postgresql.Driver";
String dir = "jdbc:sqlite:test.db";
String user = "postgres_usuario";
String pass = "postgres_senha";
try {
Class.forName("org.sqlite.JDBC");
con = (Connection) DriverManager.getConnection(dir, user, pass);
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
Thanks in advance!
You’re not mixing data from a bank
sqlite
with apostgresql
? It could also include the error generated in your question?– Wakim
Yes that’s what I tried to do. Anything else that changes is not just Class.forName("Content")?
– user11893