Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Error :"Invalid Cursor State" (http://www.velocityreviews.com/forums/t750646-error-invalid-cursor-state.html)

dhavalthakor28691 06-29-2011 07:59 AM

Error :"Invalid Cursor State"
 
M getting error Invalid cursor state
here is my code.
i can able to store data in database..in this part i m getting error..
im nt able get value of usercount column
plz help me
thnx in advance


//additionalInfo table has two colm 1>userCountId2>userCount
public class TestConnection
{
public static Connection con=null;

public static void main(String args[])
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:sqlserver") ;
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIV E,ResultSet.CONCUR_UPDATABLE);
String str = "select * from additionalInfo where userCountId=1";
ResultSet rs = stmt.executeQuery(str);
int count = rs.getInt("userCount");
/*
boolean b= true;
while(b)
{
rs.getInt("userCount");
b=rs.next();
}
//int count =rs.getInt(1);
*/


}catch(Exception e)
{
//System.out.println(e.getMessage()+e.printStackTrac e());
e.printStackTrace();
}
}


All times are GMT. The time now is 12:56 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.