This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I m calling stored procedure using spring frame work. My application server on production environment ins Web sphere and data source is configured and connection is retrieved through jndi. My code require Connection object to commit the transactions. Im getting below error when executing the application in WAS.
Please let me know the way to avoid this error. My application runs on tomcat in my local machine and WAS in my production machine.
I wasn't - and still am not - sure whether this problem is caused by misconfiguration of the datasources, or by trying to use some Oracle specific functionality on the WSJdbcConnection without calling getNativeConnection first (there are articles on the web which suggest this possibility). If it is the second case, the StackOverflow article wouldn't apply. And since your post didn't explain why did you think the SO article applies, I've mentioned that we might not know the details. I'm no expert on this, and if you are really sure that the only way the message can appear is the issue described in the StackOverflow article, I don't have anything to add.
Anton Novopashin wrote:Second of all if you are developing in J2EE environment best way is use standards.
I wanted to pass list of objects to my stored procedure through Springs. Hence, I implemented ArrayDescriptor from oracle package. Now, on running my code on WAS server, server throws below error. I have set up the datasource in WAS admin console and looks like WAS wraps the connection object as WSJdbcConnection, which is not compatible with OracleConnection which ArrayDescriptor requires.
I tried normal typecasting from WSJdbcConnection to OracleConnection and this is not working. My requirement is to run the code on both Tomcat and WAS server.
With that said, after some research on google I found that spring framework provides native jdbc classes and hence I used CommonDbcpNativeJdbcExtractor for Tomcat and WebSphereNativeJdbcExtractor for WAS as below
Please let me know if this is the right approach or am I going on wrong direction.