Exception executing simple statement
From: Frank Brouwer (frank.brouwer_nospam_at_trimergo.nl)
Date: 10/20/03
- Previous message: Jo3: "Secure connection to a SQL database from a Java client"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 20 Oct 2003 10:47:55 +0200
Hi all,
Executing next statement results in Exception below:
select t1.calendar_key, t1.calbase_key, t1.description, t1.calendar_number
from calendar_global t1
where t1.calendar_key = ?
And here is the java coding:
// Setup stuff for reading the calendars.
PreparedStatement ps =
con.prepareStatement(CalendarDataSql().getGlobalCalendarSql());
PreparedStatement ps1 =
con.prepareStatement(CalendarDataSql().getBaseCalendarSql());
PreparedStatement ps2 =
con.prepareStatement(CalendarDataSql().getDetailsCalendarSql());
ResultSet rs;
// Set parameter and execute statement.
ps.setString(1,cid);
rs = ps.executeQuery(); <== First Exception on this line (see below).
// If no reccord, return null otherwise process this reccord and
continue.
if (!rs.next()) return null; <== Seccond, third, fourth, .... time
executing, Exception here (see below).
--------- First exception --------------
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer]sp_cursorfetch: The cursor identifier value provided (0) is
not valid.
at
com.microsoft.jdbc.base.BaseExceptions.createException(Ljava.lang.String;Lja
va.lang.String;I)Ljava.sql.SQLException;(Unknown Source)
at
com.microsoft.jdbc.base.BaseExceptions.getException(Ljava.sql.SQLException;I
I[Ljava.lang.String;Ljava.lang.String;I)Ljava.sql.SQLException;(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken()V(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(BLcom.microsof
t.jdbc.base.BaseWarnings;)Z(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(BLcom.micro
soft.jdbc.base.BaseWarnings;)Z(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Lcom.microsoft.jdbc
.base.BaseWarnings;)V(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Lcom.microsoft.
jdbc.base.BaseWarnings;)V(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute()V(Optimized
Method)
at com.microsoft.jdbc.base.BaseStatement.commonExecute()V(Unknown Source)
at
com.microsoft.jdbc.base.BaseStatement.executeQueryInternal()Ljava.sql.Result
Set;(Unknown Source)
at
com.microsoft.jdbc.base.BasePreparedStatement.executeQuery()Ljava.sql.Result
Set;(Unknown Source)
------------------ Rest truncated ------------------------
-------------------- Seccond, third, fourth, ..... exception.
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unhandled
token type: ROW
at
com.microsoft.jdbc.base.BaseExceptions.createException(Ljava.lang.String;Lja
va.lang.String;)Ljava.sql.SQLException;(Unknown Source)
at
com.microsoft.jdbc.base.BaseExceptions.getException(I[Ljava.lang.String;)Lja
va.sql.SQLException;(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(BLcom.microsof
t.jdbc.base.BaseWarnings;)Z(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(BLcom.micro
soft.jdbc.base.BaseWarnings;)Z(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Lcom.microsoft.jdbc
.base.BaseWarnings;)V(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Lcom.microsoft.
jdbc.base.BaseWarnings;)V(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute()V(Optimized
Method)
at com.microsoft.jdbc.base.BaseStatement.commonExecute()V(Unknown Source)
at
com.microsoft.jdbc.base.BaseStatement.executeQueryInternal()Ljava.sql.Result
Set;(Unknown Source)
at
com.microsoft.jdbc.base.BasePreparedStatement.executeQuery()Ljava.sql.Result
Set;(Unknown Source)
------------------------ Rest truncated ------------------------
Who has a clue????
Thanks,
Frank.
- Previous message: Jo3: "Secure connection to a SQL database from a Java client"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|