From: | arun vc <vcarun(at)yahoo(dot)co(dot)uk> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | problem in resultset relative method |
Date: | 2002-05-03 07:49:24 |
Message-ID: | 20020503074924.8233.qmail@web11503.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
hello
i have found some problem in using the relative()
method of ResultSet
the problem occured when i upgrade my old
postgres.jar driver with the new one posted on ur site
http://jdbc.postgresql.org/download/pgjdbc2.jar
try exicte this program using both drivers
and u will find the difference
import java.sql.*;
public class sqlDriverTest
{
String Driver = "org.postgresql.Driver";
String Bridge="jdbc:postgresql://localhost/database";
String LoginName="postgres";
String Password="postgres";
try
{
Class.forName(Driver);
Connection con=
DriverManager.getConnection(Bridge,LoginName,Password);
System.out.println("Connection made: " + con);
PreparedStatement pm=con.prepareStatement("SELECT *
FROM admin");
ResultSet rs=pm.executeQuery();
rs.last();
int tot=rs.getRow(); //my tot returned 10 records
rs.beforeFirst();
int kk=1;
while(kk<=tot) //the program stoped after reading 3
records and rest of the 7 records are shown wrongly
{
rs.relative(kk);
System.out.println(rsProj.getString(1));
kk=kk+1;
}
}
catch(Exception e)
{
System.out.println("Error "+e.getMessage());
}
}
//the program stoped after reading first 3 records
and rest of the 7 records are shown wrongly
//why iam getting error in using relative() method
this problem was not in the previous postgres.jar
driver
please look in to this problem
=====
The Future belongs to those who believe in the beauty of their dreams...............................................
Arun VC, E Team India Web Solutions,
Serene,Anupama Nagar,Pongummoodu,Trivandrum
Phone : +91 471 558089. Fax : +91 471 551807.
http://www.e-teamindia.com
http://www.geocities.com/vcarun
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Chantal Ackermann | 2002-05-03 09:45:43 | retrieving configuration of an existing database |
Previous Message | Scott Burgess | 2002-05-03 07:26:22 | Locking a table... |