Hello everybody,
we have a problem using your Access JDBC driver:
Class.forName("com.hxtt.sql.access.AccessDriver");
String url = "jdbc:access:/DRIVE:/PATH/FILE.mdb";
String user = "sa";
String password = "";
Connection con = DriverManager.getConnection(url, user, password);
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
[...]
ResultSet rs = getResultSet();
rs.absolute(r + 1); //ERROR OCCURS HERE
return rs.getObject(c + 1);
------------------------
ERROR MESSAGE:
java.sql.SQLException: Please move the cursor to a data row first!
at com.hxtt.global.SQLState.SQLException(Unknown Source)
at com.hxtt.sql.cu.new(Unknown Source)
at com.hxtt.sql.cu.getString(Unknown Source)
at com.hxtt.sql.cu.getObject(Unknown Source)
[my class where the error occurs]
Any idea?
Regards,
Timo
|
>Scrolling cursor support?
Support.
>ResultSet rs = getResultSet();
>rs.absolute(r + 1); //ERROR OCCURS HERE
>return rs.getObject(c + 1);
You should use
if(rs.absolute(r + 1)){
return rs.getObject(c + 1);
}else{
//.... do your other operation. Now you're here
}
|
Thanks for your response!
Doesn't work. The table has round about 40.000 entries, but the record occurs not on every record.
I use my own TableModel and the methods rs.absolute() and rs.getObject() are called in the getValueAt(int r, int c) (in the TableModel) by the JTable. I have tested your code, it didn't help.
What else can I do?
Sincerly yours,
Timo
|
>What else can I do?
Recurred and supported. Please download the latest package.
|
Thanks! I've downloaded the latest packages and tested it on a MDB file with 42.000 records and round about 25 columns. It works now, but the performance is horrible slow :-( Scrolling in the JTable from the first record downwards takes about 1 minute...
Regards,
Timo
|
We will try to quicker it soon.
|
BTW, if you use ResultSet.setFetchSize(60000), you will find it become quicker.
Because MDB isn't record oriented, absolute need to do some caluculation so that it's slower to use absolute method. We will try to complement cache code to quicker it.
|
>Scrolling in the JTable from the first record downwards takes about 1 minute...
Please download the latest package, which have quicken that ResultSet.absolute function.
|