Hello everybody, I have doubts on the functioning of SQLContainer, I did the class that connects to the database PostgreSQL, a SimpleJDBCConnectionPool but do not know how to call on my home page set up the container, I’ve read the tutorial but I could not understand how to this call. Could you give me an example.
Sorry, but I can not instantiate the class and get the method in my main page.
Here is the code of connection.
public class Conexao {
private JDBCConnectionPool conexao = null;
private SQLContainer container = null;
public Conexao() {
iniciarConexao();
}
private void iniciarConexao() {
try {
conexao = new SimpleJDBCConnectionPool("org.postgresql.Driver",
"jdbc:postgresql://localhost:5433/sgdlv", "postgres", "xxxxxxxx", 2, 5);
TableQuery tbPessoa = new TableQuery("pessoa", conexao);
tbPessoa.setVersionColumn("test1");
container = new SQLContainer(tbPessoa);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
I appreciate the attention and help because this project for my work and completion of course, have to close by the end of the year.