Hi
Im pretty new to JDBC and all that. At uni we are doing a project and im having a bit of difficulty with exceptions.
We mainly use NBCachedRowSet from org.netbeans.lib.sql.*
i used the following code to return a NBCachedRowSet.
try
{
NBCachedRowSet rowset = new NBCachedRowSet();
ConnectionSource connSrc = getConnector(database);
rowset.setConnectionSource(connSrc);
rowset.setCommand(query);
return rowset;
}
catch (SQLException e) { System.out.println(e.getSQLState()); }
"query" is the given SQL query string.
This works fine and i can use the returned rowset without any problems.
My problem is actually that even when the query is invalid it doesnt complain. When i use the rowset in a tablemodel then it just keeps the table empty but still doesnt complain. The thing is... I want it to complain that the query is invalid !!!
I tried using rowset.execute(query) instead of rowset.setCommand(query) but still no SQLException. I tried using "asdfasdf" as the query which is obviously rubbish but still no Exception is thrown !!!
What am i missing out here??