aspose file tools*
The moose likes JDBC and the fly likes Restricting the rows fetched Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Restricting the rows fetched" Watch "Restricting the rows fetched" New topic
Author

Restricting the rows fetched

bharat yadav
Greenhorn

Joined: May 27, 2003
Posts: 1
Hello ,
I m using JDBC to connect to Sybase Adaptive IQ 12.4.3 server.I am trying to limit the size of rows fetched from a table which contains 12 lac records.After selecting the records I am writing them to a flat file using Export in sybase.
But my set rowcount statement is not showing any effect and whole of my 12 lac records are written into the file.The code i m using is as below:
boolean b=stmt.execute("select customer_key,month_key,service_key,status_key,comb
ined_revenue into #temporary from telco_facts ");
stmt.execute("set rowcount 100");
stmt.execute("SET TEMPORARY OPTION Temp_Extract_Name1='f:\\topRec.txt'");
stmt.execute("select * from telco_facts order by service_key");
If instead of exporting the data into flat file ,I select it into a resultset
set row count works.I m using JConnect 5.5 JDBC driver.
I also tried stmt.setFetchSize(100) but that also is not working.
Please suggest me how should I resolve this problem.
Is there any other way of restricting the no of rows selected at the server itself.
Thanks in advance.
Bharat
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Restricting the rows fetched
 
Similar Threads
JDBC and Sybase
Pagination using jsp and Sybase
How to retrieve partial data in SQL Server ?
Problem facing with FlatFIle adapter in websphere integration developer7.0
Row information from ResultSet