Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

currentSchema issue in Tomcat6.0

 
subbukumararaja chandrasekaran
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18156
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
subbukumararaja chandrasekaran
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18156
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Tim.

Actually in both cases i have used Tomcat 6 only.

Just the JDK version differed.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18156
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Time to contact IBM, I guess.
 
subbukumararaja chandrasekaran
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic