I got some module interfacing problem, due to a library usage.
http://technojeeves.com/joomla/index.php/free/59-resultset-to-tablemodel
I had to pass the Resultset Object out of the Database Module. As you might think, It is not that modular for programming. So I did something like this
public ResultSet getEmployee()
{
PreparedStatement pst = null;
ResultSet rs = null;
String sql = "select * from employees";
try
{
pst = conn.PreparedStatement(sql);
rs = pst.executeQuery();
}
catch (SQLException e)
{
OptionPane.showMessageDialog(null, "Database Access Error");
}
return rs;
}
On some display module, I did
tblEmp.setModel(DbUtils.resultSetToTableModel(rs));
Now I am hassling to finish polishing up my project for delivery and suddenly found this post.
Where to close java PreparedStatements and ResultSets?
And come to realize what I all did was wrong. I had to pass out a "set" object out of the Database module. But as you see, the library is not intended to be used that way. How can I fix that in order to close all resultsets properly? Thanks