File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Update and Insert do not work after migrating to WebSphere 7.0 from WebSphere 6.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Update and Insert do not work after migrating to WebSphere 7.0 from WebSphere 6.1" Watch "Update and Insert do not work after migrating to WebSphere 7.0 from WebSphere 6.1" New topic
Author

Update and Insert do not work after migrating to WebSphere 7.0 from WebSphere 6.1

Ravinder Rao
Greenhorn

Joined: Oct 01, 2012
Posts: 5
I have a method written in java to execute the SQL statment for INSERT,UPDATE and DELETE modes. This was working on WebSphere 6.1 and after upgrading to WebSphere 7.0 it stopped working.

Below is my code :



Below is my Error stack trace :

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

Welcome to CodeRanch!

There was an error updating the admin table. Please check the data for errors and format. com.microsoft.sqlserver.jdbc.SQLServerException: Cannot update identity column 'PRODUCT_ID'.com.microsoft.sqlserver.jdbc.SQLServerException: Cannot update identity column 'PRODUCT_ID'.

This appears to be the error. Did you update your database or jdbc driver when you upgraded WebSphere? Because this error doesn't appear to be related to the version of WAS.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Ravinder Rao
Greenhorn

Joined: Oct 01, 2012
Posts: 5
Yes the drivers are upgraded.
Ravinder Rao
Greenhorn

Joined: Oct 01, 2012
Posts: 5
This is what i get when i do a test run in admin console

[10/2/12 12:21:13:146 GMT-06:00] 0000003b DSConfigurati I DSRA8203I: Database product name : Microsoft SQL Server
[10/2/12 12:21:13:147 GMT-06:00] 0000003b DSConfigurati I DSRA8204I: Database product version : 9.00.3205
[10/2/12 12:21:13:147 GMT-06:00] 0000003b DSConfigurati I DSRA8205I: JDBC driver name : Microsoft SQL Server JDBC Driver 3.0
[10/2/12 12:21:13:147 GMT-06:00] 0000003b DSConfigurati I DSRA8206I: JDBC driver version : 3.0.1301.101
[10/2/12 12:21:13:148 GMT-06:00] 0000003b DSConfigurati I DSRA8025I: Successfully connected to DataSource.

But my Websphere variables is pointed to JDBC Driver 4.0

MICROSOFT_JDBC_DRIVER_PATH C:\Program Files (x86)\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu

MICROSOFT_JDBC_DRIVER_NATIVEPATH C:\Program Files (x86)\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\auth\x86
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18150
    
    8

So your configuration is not working the way you expected. Go into the administration console and review how you have your data sources configured. (Also review your code to make sure it actually uses the data sources, instead of accessing a JDBC driver which gets installed in your application's WEB-INF/lib directory.)
Ravinder Rao
Greenhorn

Joined: Oct 01, 2012
Posts: 5
When i use the latest sqljdbc4.jar i get the below error when testing to connect to a database responsible for authentication.

[10/4/12 11:47:27:201 GMT-06:00] 0000001d SystemErr R java.sql.SQLException: SQL Server version 8 is not supported by this driver. ClientConnectionId:3908e14b-5db1-444a-8779-2fa400ec6ec0DSRA0010E: SQL State = 08S01, Error Code = 0
Ravinder Rao
Greenhorn

Joined: Oct 01, 2012
Posts: 5
I solved it by using http://jtds.sourceforge.net/ . This works with both SQL Server and Sybase. The issue i was having is that my application uses both MS SQL Server 2000 and 2008. sqljdbc4.jar is good for later but not former. Using jtds1.2.6.jar and updating driver string resolved.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Update and Insert do not work after migrating to WebSphere 7.0 from WebSphere 6.1
 
Similar Threads
Problem with SOAP Fault - no SOAP fault message returned to consumer
Websphere Commerce : from Java filter to Struts action mapping
java.lang.IndexOutOfBoundsException
Problem with Webservice in IBM WebSphere Server
java.lang.NullPointerException in action class