Re: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
import java.io.*;
import java.util.*;
import java.sql.*;
class empListCondition {
@SuppressWarnings("deprecation")
public static void main(String[] args)throws SQLException,IOException,ClassNotFoundException
{
DataInputStream dis=new DataInputStream(System.in);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbcdbc:jeevan_db ","system","Passpass1");
Statement st=con.createStatement();
//------condition 1---------
System.out.println("enter eno");
int no=Integer.parseInt(dis.readLine());
ResultSet rs=st.executeQuery("select ename,esal from emp where eno="+no);
System.out.println("details are"+rs.getString("ename"));
rs.close();
st.close();
con.close();
}
}
################################################## #
this time i installed 11g R2 and connection got established and still following are the run time errors i am facing!!!
################################################## #
my table is: create table emp(eno number(5),ename varchar2(10),esal number(10));
################################################## #
i inserted : insert into emp values(1,'jeevan',100);
insert into emp values(2,'jeevan1',1000);
C:\Users\Wade\Desktop\javaprogs>java empListCondition
enter eno
2
Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC Driver Manage
r] Invalid cursor state
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(Unkn own Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
at empListCondition.main(empListCondition.java:16)
################################################## #####
god help me please guys
Re: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
Quote:
Originally Posted by
jeevan reddy mandali
import java.io.*;
import java.util.*;
import java.sql.*;
class empListCondition {
@SuppressWarnings("deprecation")
public static void main(String[] args)throws SQLException,IOException,ClassNotFoundException
{
DataInputStream dis=new DataInputStream(System.in);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbcdbc:jeevan_db ","system","Passpass1");
Statement st=con.createStatement();
//------condition 1---------
System.out.println("enter eno");
int no=Integer.parseInt(dis.readLine());
ResultSet rs=st.executeQuery("select ename,esal from emp where eno="+no);
System.out.println("details are"+rs.getString("ename"));
rs.close();
st.close();
con.close();
}
}
################################################## #
this time i installed 11g R2 and connection got established and still following are the run time errors i am facing!!!
################################################## #
my table is: create table emp(eno number(5),ename varchar2(10),esal number(10));
################################################## #
i inserted : insert into emp values(1,'jeevan',100);
insert into emp values(2,'jeevan1',1000);
C:\Users\Wade\Desktop\javaprogs>java empListCondition
enter eno
2
Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC Driver Manage
r] Invalid cursor state
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(Unkn own Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
at empListCondition.main(empListCondition.java:16)
################################################## #####
god help me please guys
1. Read the forums Rules.
2. Don't use others threads to post your own problem.
3. Create a new thread in specified category.
Re: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
@jeevan reddy mandali
to continue Mr.777 post:
4) Do not hijack a thread that is over 3 years old...in fact, do not hijack anyone's thread for that matter. I have moved your thread to one if its own
5) Do not send out PM's to people expecting specialized help from them. Doing so defeats the purpose of public forums, and further makes you appear as if your time is more valuable than anyone else's in the forums - and yes this can hurt your chances of receiving help.