Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ADF and MSSQL 2005 problems -> FOR UPDATE clause allowed only for DECLARE C

750656Feb 1 2010 — edited Feb 2 2010
Hi all.

I have a legacy application which uses MS SQL server 2000 / 2005. I've started to build up a new version of this application using JDev + ADF stack.

Everything went ok until I've tried to update some data in a Form. I'm getting this error:

com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR

Can someone figure out what's wrong?

1) In a MSSQL server connection string, normally we define the 'SelectMethod' parameter to 'cursor', as follows: jdbc:sqlserver://$host$:$port$;databaseName=dbserver;SelectMethod=cursor
Since I was not able to do this through my project's 'Application Resources > Connections' screen, I could not evaluate if this is the cause
2) I'm trying to follow the steps of an Oracle tutorial (http://www.oracle.com/technology/obe/obe11jdev/ps1/ria_application/developriaapplication_long.htm#ad), of course using MS SQL server instead of Oracle, and using some master->detail tables like the example suggests (in the tutorial, I've reached the step 11, then tried to update a record, which causes the mentioned exception)


Follows the stacktrace:

<Utils><buildFacesMessage> ADF: Adding the following JSF error message: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.
com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getMoreResults(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.seekToOutParams(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.getPrepStmtHandle(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doPrepExec(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelectForAltKey(BaseSQLBuilderImpl.java:707)
at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:546)
at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:7789)

Regards,
Luciano S. Lorencini, SCJP, SCWCD
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2010
Added on Feb 1 2010
7 comments
2,463 views