File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Error in allocating a connection. Cause: sun.jdbc.odbc.JdbcOdbcDriver cannot be cast to javax.sql.Da Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Error in allocating a connection. Cause: sun.jdbc.odbc.JdbcOdbcDriver cannot be cast to javax.sql.Da" Watch "Error in allocating a connection. Cause: sun.jdbc.odbc.JdbcOdbcDriver cannot be cast to javax.sql.Da" New topic
Author

Error in allocating a connection. Cause: sun.jdbc.odbc.JdbcOdbcDriver cannot be cast to javax.sql.Da

ankur garha
Greenhorn

Joined: Mar 13, 2010
Posts: 11
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Resource Definitions //EN" "http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">
<resources>

<jdbc-resource enabled="true" jndi-name="jdbc/leagueDB" object-type="user" pool-name="myPool">
<description/>
</jdbc-resource>

<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="sun.jdbc.odbc.JdbcOdbcDriver" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="myPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
<property name="User" value="sa"/>
<property name="Password" value="'()'"/>
<property name="serverName" value="HOME-745016E4F9"/>
<property name="portNumber" value="1433"/>
<property name="databaseName" value="soccer"/>
</jdbc-connection-pool>
</resources>




but when im running my project using netbeans and glassfish webserver....it gives me folowing run time error....

Error in allocating a connection. Cause: sun.jdbc.odbc.JdbcOdbcDriver cannot be cast to javax.sql.DataSource...


Ankur Garha
J2SE/J2EE Developer
OCJP 1.6
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
datasource-classname="sun.jdbc.odbc.JdbcOdbcDriver"


Can you change the upper definition with the following "sun.jdbc.odbc.ee.DataSource"?

Regards,

Fatih.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in allocating a connection. Cause: sun.jdbc.odbc.JdbcOdbcDriver cannot be cast to javax.sql.Da
 
Similar Threads
just firt web service is working
[JPA 2.0] Redoploying app deletes my database?
lass name is wrong or classpath is not set
Connecting jsp with derby
Class name is wrong or classpath is not set