craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > JDBC/Database Issues Post New Topic   Post A Reply
Postgres dynamic load of records printer friendly version
next newest post | next oldest post
Author Messages
Hans
Unregistered
Edit or delete this message Reply w/Quote
Posted Sunday, July 15, 2007 @ 07:59:18  

Hi everybody !

I use the latest build of QuickTable and try to load data from a Postgres DB.

My problem is, that always all rows where fetched. Even on large tables.
If I ran the same code against a MS SQL Database it loads on demand.
I am also using the lastest Postgres JDBC driver (8.2-505).
I tried the JDBC2 and JDBC4 version, with the same result.

My code looks like this:

quick.dbtable.DBTable dBTable1 = new quick.dbtable.DBTable();
this.add (dBTable1);
dBTable1.setConnection(parentDba.dbCon);
dBTable1.setSelectSql("SELECT * FROM debtable_assignments ORDER BY id");
dBTable1.createControlPanel();
try
{
dBTable1.refresh();
}
catch(SQLException e)
{
e.printStackTrace();
}

Thanks for your time,

Hans

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Monday, July 16, 2007 @ 11:11:20  

Enable debug log and check command line output about why it is fetching all records.

quick.dbtable.DBTable dBTable1 = new quick.dbtable.DBTable();
dBTable1.debug=true;

Most probably it was not able to generate the rowcount sql. In that case assign a rowcount using the method setRowCountSql() . refer api.

Hans
Unregistered
Edit or delete this message Reply w/Quote
Posted Monday, July 16, 2007 @ 13:46:23  

Hi !

Unfortunately it doesn't helped.
I provided a (manually checked) RowCount clause with no success.

Here is the Debug Output.

QuickTable 2.0.5.27
Executing row count sql=SELECT COUNT (*) FROM caleventtable
Time taken to execute rowcount sql=31ms
Time taken to execute select sql=156ms
Initializing column properties. Any properties set using getColumn(i).setXXXX() will be lost. To retain old column properties use 'DBTable.useOldColumnProperties(boolean val)', if needed.
Database meta data information received from jdbc driver
Column 1: Name: caleventid
ReadOnly: false
Data Type: INTEGER
Precision: 10
Scale: 0
Signed: true

Column 2: Name: summary
ReadOnly: false
Data Type: VARCHAR
Length: 65

The PostgreSQL log shows this:

2007-07-16 20:53:32 LOG: connection received: host=127.0.0.1 port=1764
2007-07-16 20:53:32 LOG: connection authorized: user=crm database=crm_20070713
2007-07-16 20:53:32 LOG: statement: SELECT COUNT (*) FROM caleventtable
2007-07-16 20:53:32 LOG: statement: SELECT caleventid, summary FROM caleventtable ORDER BY caleventid
2007-07-16 20:53:32 LOG: statement: SELECT attnotnull FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2
2007-07-16 20:53:32 LOG: statement: SELECT attnotnull FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2

Thanks,

Hans

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Monday, July 16, 2007 @ 21:31:20  

How did you confirm that all the records are fetched at the start itself?
Hans
Unregistered
Edit or delete this message Reply w/Quote
Posted Tuesday, July 17, 2007 @ 10:39:03  

Hi !

I checked the server log from database.
The PostgreSQL log shows this:

2007-07-16 20:53:32 LOG: connection received: host=127.0.0.1 port=1764
2007-07-16 20:53:32 LOG: connection authorized: user=crm database=crm_20070713
2007-07-16 20:53:32 LOG: statement: SELECT COUNT (*) FROM caleventtable
2007-07-16 20:53:32 LOG: statement: SELECT caleventid, summary FROM caleventtable ORDER BY caleventid
2007-07-16 20:53:32 LOG: statement: SELECT attnotnull FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2
2007-07-16 20:53:32 LOG: statement: SELECT attnotnull FROM pg_catalog.pg_attribute WHERE attrelid = $1 AND attnum = $2

Thanks,

Hans

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Tuesday, July 17, 2007 @ 12:18:05  

quicktable will always execute the full query

SELECT caleventid, summary FROM caleventtable ORDER BY caleventid

but it will fetch only the visible records from the resulset. As users scroll down, it will fetch more records from the resultset.

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios