Thanks, this has been resolved.
I did not put SET NOCOUNT ON in the stored procedure. So the stored
procedure was returning the updated rows as well as the result set.
The two possible solutions to this are
1. Put SET NOCOUNT ON in stored procedure OR
2. Check for the return value and call getMoreResults to get the result set.
This was working with the weblogic's mssqlserver4 driver. Looks like it
ignores the update count.
Thanks!
-----Original Message-----
From: Ravi Vedire [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 8:36 AM
To: JRun-Talk
Subject: sqlserver JDBC driver problem
Hello,
I am testing the new JDBC drivers of SP2a on Windows 2000 with sqlserver and
I am having a problem getting back a resultset from a stored procedure that
does an insert.
The stored procedure does the inserts when called from the Java code but I
do not get the result set.
If I modify the stored procedure to just return the resultset without doing
the insert, and call it from Java code I get the resultset.
Any Ideas, why I am not able to get the result set that is returned after an
insert?
Thanks,
Ravi
A snippet of the java code:
if (dbConnection != null)
{
CallableStatement callStatement = null;
// get the sessionId
int sessionId;
String setMarkerSQL =
"{CALL Create_PositionMarker2(?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?)}";
callStatement = dbConnection.prepareCall(setMarkerSQL,
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY );
callStatement.setInt( 1, 64 );
callStatement.setInt( 2, 1234 );
callStatement.setInt( 3, 40007 );
callStatement.setString( 4, "S30076" );
callStatement.setString( 5, "Test1");
callStatement.setString( 6, "Test2" );
callStatement.setString( 7, "Test3" );
callStatement.setInt( 8, 123 );
callStatement.setInt( 9, 456 );
callStatement.setString( 10, "Test4" );
callStatement.setString( 11, "Active");
callStatement.setInt( 12, 1234);
callStatement.setString( 13, "123456");
boolean brtn = callStatement.execute();
if(brtn == true)
results = callStatement.getResultSet();
if (null != results) {
results.next();
sessionId = results.getInt(1);
results.close();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists