-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: java.sql.SQLException: No suitable driver
PostPosted: Tue Jun 15, 2004 1:46 pm 
Newbie

Joined: Tue Jun 15, 2004 1:16 pm
Posts: 2
I just start to use the Hibernate. I have the following error.

10:41:38,984 INFO DriverManagerConnectionProvider:42 - Using Hibernate built-in connection pool (not for production use!)
10:41:38,984 INFO DriverManagerConnectionProvider:43 - Hibernate connection pool size: 20
10:41:39,156 INFO DriverManagerConnectionProvider:77 - using driver: COM.ibm.db2.jdbc.app.DB2Driver at URL: jdbc:db2://localhost:6789/ejbbank
10:41:39,156 INFO DriverManagerConnectionProvider:78 - connection properties: {user=db2admin , password=db2admin }
10:41:39,172 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
10:41:39,203 WARN SettingsFactory:95 - Could not obtain connection metadata
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:563)
at java.sql.DriverManager.getConnection(DriverManager.java:163)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:101)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at com.ibm.hibernate_article.InsertDept.main(InsertDept.java:25)
10:41:39,203 INFO SettingsFactory:102 - Use scrollable result sets: false
10:41:39,219 INFO SettingsFactory:105 - Use JDBC3 getGeneratedKeys(): false
10:41:39,219 INFO SettingsFactory:108 - Optimize cache for minimal puts: false
10:41:39,234 INFO SettingsFactory:117 - Query language substitutions: {}
10:41:39,234 INFO SettingsFactory:128 - cache provider: net.sf.ehcache.hibernate.Provider
10:41:39,234 INFO Configuration:1093 - instantiating and configuring caches
10:41:39,422 INFO SessionFactoryImpl:119 - building session factory
10:41:39,969 INFO SessionFactoryObjectFactory:82 - no JNDI name configured
10:41:40,031 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: 08001
10:41:40,047 ERROR JDBCExceptionReporter:46 - No suitable driver
10:41:40,078 ERROR JDBCExceptionReporter:38 - Cannot open connection
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:563)
at java.sql.DriverManager.getConnection(DriverManager.java:163)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:101)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3302)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3282)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:61)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:56)
at net.sf.hibernate.impl.BatcherImpl.prepareBatchStatement(BatcherImpl.java:109)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:460)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at com.ibm.hibernate_article.InsertDept.main(InsertDept.java:40)
10:41:40,094 ERROR SessionImpl:2375 - Could not synchronize database state with session
net.sf.hibernate.JDBCException: Cannot open connection


Here is my hibernate.properties
hibernate.connection.driver_class = com.mysql.jdbc.Driver
hibernate.connection.url = jjdbc:mysql://localhost/ejbbank
hibernate.connection.username = db2admin
hibernate.connection.password = db2admin
hibernate.dialect = net.sf.hibernate.dialect.DB2Dialect


I know the JDBC driver is there. I removed it and I got different error. Did I miss something?

Please advice.

Thanks,
Andy


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 16, 2004 1:14 pm 
Beginner
Beginner

Joined: Mon Jun 07, 2004 4:21 pm
Posts: 44
Location: Boston
I see a typo in your posted properties. Could that be the problem?:

hibernate.connection.url = jjdbc:mysql://localhost/ejbbank


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.