File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes currentSchema issue in Tomcat6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "currentSchema issue in Tomcat6.0" Watch "currentSchema issue in Tomcat6.0" New topic
Author

currentSchema issue in Tomcat6.0

subbukumararaja chandrasekaran
Greenhorn

Joined: Sep 24, 2010
Posts: 17
Hi All,

When i am trying to implement DBCP in Tomcat 6.0 with Jdk1.6 as the enviroment, i am getting the error below;

"org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The "currentSchema" property is not allowed on the target server.)"

I cannot set the schema using "SET SCHEMA". So could somebody please tell me how we can configure the currentSchema in tomcat 6.0.

Please find my context.xml settings.


<Resource auth="Container" driverClassName="com.ibm.db2.jcc.DB2Driver" maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/name" password="xxxxx" type="javax.sql.DataSource" url="jdbc:db2://host:port/DB:currentSchema=schema_name;" username="uname"/>


Could somebody help me that why i am getting this error.

Note: I have implemented the DBCP in Tomcat6.0 with JDK1.5 are environment.

Thanks,
Subbu
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

This isn't a Tomcat problem, it's a DB2 problem. What it's saying is that the DB2 JDBC Driver is parsing your JDBC URL and the DB2 host or driver isn't accepting the "currentSchema" property. So you need to check which version of DB2 you're running and make sure you're using a compatible driver.

The currentSchema property is supported on DB2 Version 9.1. Older versions of DB2 may not support it. It's possible that some newer versions may not like it either, but that's not as certain.


Customer surveys are for companies who didn't pay proper attention to begin with.
subbukumararaja chandrasekaran
Greenhorn

Joined: Sep 24, 2010
Posts: 17
Thanks a lot Tim.

But i have used the same DB2 for my Tomcat6 + jdk1.5 environment. there it worked fine and still its working.

The currentSchema has been recognized in the above environment.

The only difference is JDK version. that is not enough to throw this error. Thats why i got confused.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

I would check the DB2 driver in TOMCAT_HOME/lib.

The only difference in dbcp between Tomcat 5 and Tomcat 6 is that the 3 separate tomcat library directories were removed and replaced with the single "lib" directory. So most likely you're not using the same version of DB2 driver file as you used in Tomcat5.
subbukumararaja chandrasekaran
Greenhorn

Joined: Sep 24, 2010
Posts: 17
Sorry Tim.

Actually in both cases i have used Tomcat 6 only.

Just the JDK version differed.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

Time to contact IBM, I guess.
subbukumararaja chandrasekaran
Greenhorn

Joined: Sep 24, 2010
Posts: 17
Thanks Tim.

Actually, i found one difference. The JDK1.5 i used in my success scenario is from SUN Microsystems.

The the JRE 1.6 i am using currently is from IBM. I don't know that may be a cause or not.

Let me change it to jdk1.6 and verify.
subbukumararaja chandrasekaran
Greenhorn

Joined: Sep 24, 2010
Posts: 17
This issue is resolved.

The root cause was like, Tomcat is looking JDK1.6 as the JVM region.

But i have the JDK1.5 in the JAVA_HOME.

After i corrected the JAVA_HOME it worked.

Thanks for all whoever responded.

-Subbu.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: currentSchema issue in Tomcat6.0