Hi,
I am using a ODBC SQL server driver and am having problems when trying to retrieve an Integer from SQL Server 2000.
workload.next();
itemtime = workload.getTimestamp("DATE_TIME"
;
itype = workload.getString("TYPE"
;
System.out.println("itype = " + itype);
int refnum = workload.getInt("REFNUM"
;
getInt works in other parts of the program - the only difference in this case is that the number is bigger. So I tried getDouble and getLong but still this columns data can not be retrieved. Heres the error....
itype = 1
AnalystImpl:GetWork() Errors
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataDouble(JdbcOdbc.java:3058)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataDouble(JdbcOdbcResultSet.java:5371)
at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:722)
at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:740)
at AnalystImpl.getWork(AnalystImpl.java:236)
at PMGmanagerImpl.addWorkToUser(PMGmanagerImpl.java:415)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536)
The resultset is valid and I can access other columnal data. Any thoughts please?
Rgds
Matt
I am using a ODBC SQL server driver and am having problems when trying to retrieve an Integer from SQL Server 2000.
workload.next();
itemtime = workload.getTimestamp("DATE_TIME"
itype = workload.getString("TYPE"
System.out.println("itype = " + itype);
int refnum = workload.getInt("REFNUM"
getInt works in other parts of the program - the only difference in this case is that the number is bigger. So I tried getDouble and getLong but still this columns data can not be retrieved. Heres the error....
itype = 1
AnalystImpl:GetWork() Errors
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataDouble(JdbcOdbc.java:3058)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataDouble(JdbcOdbcResultSet.java:5371)
at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:722)
at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:740)
at AnalystImpl.getWork(AnalystImpl.java:236)
at PMGmanagerImpl.addWorkToUser(PMGmanagerImpl.java:415)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536)
The resultset is valid and I can access other columnal data. Any thoughts please?
Rgds
Matt