-->
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.  [ 15 posts ] 
Author Message
 Post subject: No Suitable Driver
PostPosted: Sat Nov 22, 2003 11:39 am 
Newbie

Joined: Sat Sep 20, 2003 1:38 pm
Posts: 10
Hello there,

I am using the driver from mysql.com and it gives me the java.sql.SQLException: NOo suitable driver. This is the same driver I am using to access teh database with the site, but with the Hibernate Mapping SchemaExport I get that error. What can I do to fix it.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 1:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Start by showing:
your exception stacktrace
your hibernate.properties (espeically your jdbc url)
etc.

It's probably a mistype in one of the above (or a missing jdbc driver)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 1:32 pm 
Newbie

Joined: Sat Sep 20, 2003 1:38 pm
Posts: 10
***********************************************************
this is the stack trace
***********************************************************
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at net.sf.hibernate.tool.ddl2hbm.Gui.getConnection(Gui.java:815)
at net.sf.hibernate.tool.ddl2hbm.Gui.cmdGetTablesActionPerformed(Gui.jav
a:577)
at net.sf.hibernate.tool.ddl2hbm.Gui.access$1(Gui.java:572)
at net.sf.hibernate.tool.ddl2hbm.Gui$3.actionPerformed(Gui.java:250)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
64)





***********************************************************
HIBERNATE PROPERTIES
***********************************************************

######################
### Query Language ###
######################

## define query language constants / function names

hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'

## package imports

hibernate.query.imports net.sf.hibernate.test, net.sf.hibernate.eg



#################
### Platforms ###
#################

## JNDI Datasource

#hibernate.connection.datasource jdbc/test
#hibernate.connection.username db2
#hibernate.connection.password db2


## PostgreSQL

#hibernate.dialect net.sf.hibernate.dialect.PostgreSQLDialect
#hibernate.connection.driver_class org.postgresql.Driver
#hibernate.connection.url jdbc:postgresql:template1
#hibernate.connection.username pg
#hibernate.connection.password
#hibernate.query.substitutions yes 'Y', no 'N'


## DB2

#hibernate.dialect net.sf.hibernate.dialect.DB2Dialect
#hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
#hibernate.connection.url jdbc:db2:test
#hibernate.connection.username db2
#hibernate.connection.password db2


## MySQL

hibernate.dialect net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class org.gjt.mm.mysql.Driver
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://localhost
hibernate.connection.username root
hibernate.connection.password


## Oracle

#hibernate.dialect net.sf.hibernate.dialect.OracleDialect
#hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
#hibernate.connection.username ora
#hibernate.connection.password ora
#hibernate.connection.url jdbc:oracle:thin:@localhost:1521:test


## Sybase

#hibernate.dialect net.sf.hibernate.dialect.SybaseDialect
#hibernate.connection.driver_class com.sybase.jdbc2.jdbc.SybDriver
#hibernate.connection.username sa
#hibernate.connection.password sasasa
#hibernate.connection.rl jdbc:sybase:Tds:co3061835-a:5000/tempdb


## HypersonicSQL

#hibernate.dialect net.sf.hibernate.dialect.HSQLDialect
#hibernate.connection.driver_class org.hsqldb.jdbcDriver
#hibernate.connection.username sa
#hibernate.connection.password
#hibernate.connection.url jdbc:hsqldb:hsql://localhost
#hibernate.connection.url jdbc:hsqldb:test


## Mckoi SQL

#hibernate.dialect net.sf.hibernate.dialect.MckoiDialect
#hibernate.connection.driver_class com.mckoi.JDBCDriver
#hibernate.connection.url jdbc:mckoi:///
#hibernate.connection.url jdbc:mckoi:local://C:/mckoi0.94h/db.conf
#hibernate.connection.username admin
#hibernate.connection.password nimda


## SAP DB

#hibernate.dialect net.sf.hibernate.dialect.SAPDBDialect
#hibernate.connection.driver_class com.sap.dbtech.jdbc.DriverSapDB
#hibernate.connection.url jdbc:sapdb://localhost/TST
#hibernate.connection.username TEST
#hibernate.connection.password TEST
#hibernate.query.substitutions yes 'Y', no 'N'


## MS SQL Server

#hibernate.dialect net.sf.hibernate.dialect.SybaseDialect
#hibernate.connection.username sa
#hibernate.connection.password

## JSQL Driver

#hibernate.connection.driver_class com.jnetdirect.jsql.JSQLDriver
#hibernate.connection.url jdbc:JSQLConnect://WL99LCX27

## JTURBO Driver

#hibernate.connection.driver_class com.newatlanta.jturbo.driver.Driver
#hibernate.connection.url jdbc:JTurbo://CO3061835-A:1433/master

## WebLogic Driver

#hibernate.connection.driver_class weblogic.jdbc.mssqlserver4.Driver
#hibernate.connection.url jdbc:weblogic:mssqlserver4:CO3061835-A:1433

## Microsoft Driver (not supported!)

#hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
#hibernate.connection.url jdbc:microsoft:sqlserver://CO3061835-A:1433;SelectMethod=cursor


## Interbase

#hibernate.dialect net.sf.hibernate.dialect.InterbaseDialect
#hibernate.connection.username sysdba
#hibernate.connection.password masterkey

## DO NOT specify hibernate.connection.sqlDialect

## InterClient

#hibernate.connection.driver_class interbase.interclient.Driver
#hibernate.connection.url jdbc:interbase://localhost:3060/C:/firebird/test.gdb

## Pure Java

#hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver
#hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb


## Pointbase

#hibernate.dialect net.sf.hibernate.dialect.PointbaseDialect
#hibernate.connection.driver_class com.pointbase.jdbc.jdbcUniversalDriver
#hibernate.connection.url jdbc:pointbase:embedded:sample
#hibernate.connection.username PBPUBLIC
#hibernate.connection.password PBPUBLIC



#################################
### Hibernate Connection Pool ###
#################################

hibernate.connection.pool_size 0
hibernate.statement_cache.size 0



###########################
### C3P0 Connection Pool###
###########################

#hibernate.c3p0.max_size 2
#hibernate.c3p0.min_size 2
#hibernate.c3p0.timeout 5000
#hibernate.c3p0.max_statements 100
#hibernate.c3p0.validate false



###################################
### Apache DBCP Connection Pool ###
###################################

# connection pool

#hibernate.dbcp.maxActive 100
#hibernate.dbcp.whenExhaustedAction 1
#hibernate.dbcp.maxWait 120000
#hibernate.dbcp.maxIdle 10

## prepared statement cache

#hibernate.dbcp.ps.maxActive 100
#hibernate.dbcp.ps.whenExhaustedAction 1
#hibernate.dbcp.ps.maxWait 120000
#hibernate.dbcp.ps.maxIdle 100

# optional query to validate pooled connections:

#hibernate.dbcp.validationQuery select 1 from dual



#################################
### Plugin ConnectionProvider ###
#################################

## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)

#hibernate.connection.provider_class net.sf.hibernate.connection.DriverManagerConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.DatasourceConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.C3P0ConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.DBCPConnectionProvider



#######################
### Transaction API ###
#######################

## the Transaction API abstracts application code from the underlying JTA or JDBC transactions

#hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory
#hibernate.transaction.factory_class net.sf.hibernate.transaction.JDBCTransactionFactory


## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI
## default is java:comp/UserTransaction

#jta.UserTransaction jta/usertransaction
#jta.UserTransaction javax.transaction.UserTransaction
#jta.UserTransaction UserTransaction


## to use JTATransactionFactory with JCS caching, Hibernate must be able to obtain the JTA TransactionManager

#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.JBossTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WeblogicTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.OrionTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.ResinTransactionManagerLookup



##############################
### Miscellaneous Settings ###
##############################

## print all generated SQL to the console

#hibernate.show_sql true


## specify a JDBC isolation level

#hibernate.connection.isolation 4


## set the JDBC fetch size

#hibernate.jdbc.fetch_size 25


## set the maximum JDBC 2 batch size (a nonzero value enables batching)

hibernate.jdbc.batch_size 0


## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default)

#hibernate.jdbc.use_scrollable_resultset true


## use streams when writing binary types to / from JDBC

hibernate.jdbc.use_streams_for_binary true


## specify a default schema for unqualified tablenames

#hibernate.default_schema test


## use a custom stylesheet for XML generation (if not specified, hibernate-default.xslt will be used)

#hibernate.xml.output_stylesheet C:/Hibernate/net/sf/hibernate/hibernate-default.xslt


## enable outerjoin fetching (specifying a Dialect will cause Hibernate to use sensible default)

#hibernate.use_outer_join false



############
### JNDI ###
############

## specify a JNDI name for the SessionFactory

#hibernate.session_factory_name hibernate/session_factory


## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;
## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which
## is the best approach in an application server

#file system
#hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
#hibernate.jndi.url file:/

#WebSphere
#hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
#hibernate.jndi.url iiop://localhost:900/


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 1:36 pm 
Newbie

Joined: Sat Sep 20, 2003 1:38 pm
Posts: 10
julien wrote:
***********************************************************
this is the stack trace
***********************************************************
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at net.sf.hibernate.tool.ddl2hbm.Gui.getConnection(Gui.java:815)
at net.sf.hibernate.tool.ddl2hbm.Gui.cmdGetTablesActionPerformed(Gui.jav
a:577)
at net.sf.hibernate.tool.ddl2hbm.Gui.access$1(Gui.java:572)
at net.sf.hibernate.tool.ddl2hbm.Gui$3.actionPerformed(Gui.java:250)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
64)





***********************************************************
HIBERNATE PROPERTIES
***********************************************************

######################
### Query Language ###
######################

## define query language constants / function names

hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'

## package imports

hibernate.query.imports net.sf.hibernate.test, net.sf.hibernate.eg



#################
### Platforms ###
#################

## JNDI Datasource

#hibernate.connection.datasource jdbc/test
#hibernate.connection.username db2
#hibernate.connection.password db2


## PostgreSQL

#hibernate.dialect net.sf.hibernate.dialect.PostgreSQLDialect
#hibernate.connection.driver_class org.postgresql.Driver
#hibernate.connection.url jdbc:postgresql:template1
#hibernate.connection.username pg
#hibernate.connection.password
#hibernate.query.substitutions yes 'Y', no 'N'


## DB2

#hibernate.dialect net.sf.hibernate.dialect.DB2Dialect
#hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
#hibernate.connection.url jdbc:db2:test
#hibernate.connection.username db2
#hibernate.connection.password db2


## MySQL

hibernate.dialect net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class org.gjt.mm.mysql.Driver
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://localhost
hibernate.connection.username root
hibernate.connection.password


## Oracle

#hibernate.dialect net.sf.hibernate.dialect.OracleDialect
#hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
#hibernate.connection.username ora
#hibernate.connection.password ora
#hibernate.connection.url jdbc:oracle:thin:@localhost:1521:test


## Sybase

#hibernate.dialect net.sf.hibernate.dialect.SybaseDialect
#hibernate.connection.driver_class com.sybase.jdbc2.jdbc.SybDriver
#hibernate.connection.username sa
#hibernate.connection.password sasasa
#hibernate.connection.rl jdbc:sybase:Tds:co3061835-a:5000/tempdb


## HypersonicSQL

#hibernate.dialect net.sf.hibernate.dialect.HSQLDialect
#hibernate.connection.driver_class org.hsqldb.jdbcDriver
#hibernate.connection.username sa
#hibernate.connection.password
#hibernate.connection.url jdbc:hsqldb:hsql://localhost
#hibernate.connection.url jdbc:hsqldb:test


## Mckoi SQL

#hibernate.dialect net.sf.hibernate.dialect.MckoiDialect
#hibernate.connection.driver_class com.mckoi.JDBCDriver
#hibernate.connection.url jdbc:mckoi:///
#hibernate.connection.url jdbc:mckoi:local://C:/mckoi0.94h/db.conf
#hibernate.connection.username admin
#hibernate.connection.password nimda


## SAP DB

#hibernate.dialect net.sf.hibernate.dialect.SAPDBDialect
#hibernate.connection.driver_class com.sap.dbtech.jdbc.DriverSapDB
#hibernate.connection.url jdbc:sapdb://localhost/TST
#hibernate.connection.username TEST
#hibernate.connection.password TEST
#hibernate.query.substitutions yes 'Y', no 'N'


## MS SQL Server

#hibernate.dialect net.sf.hibernate.dialect.SybaseDialect
#hibernate.connection.username sa
#hibernate.connection.password

## JSQL Driver

#hibernate.connection.driver_class com.jnetdirect.jsql.JSQLDriver
#hibernate.connection.url jdbc:JSQLConnect://WL99LCX27

## JTURBO Driver

#hibernate.connection.driver_class com.newatlanta.jturbo.driver.Driver
#hibernate.connection.url jdbc:JTurbo://CO3061835-A:1433/master

## WebLogic Driver

#hibernate.connection.driver_class weblogic.jdbc.mssqlserver4.Driver
#hibernate.connection.url jdbc:weblogic:mssqlserver4:CO3061835-A:1433

## Microsoft Driver (not supported!)

#hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
#hibernate.connection.url jdbc:microsoft:sqlserver://CO3061835-A:1433;SelectMethod=cursor


## Interbase

#hibernate.dialect net.sf.hibernate.dialect.InterbaseDialect
#hibernate.connection.username sysdba
#hibernate.connection.password masterkey

## DO NOT specify hibernate.connection.sqlDialect

## InterClient

#hibernate.connection.driver_class interbase.interclient.Driver
#hibernate.connection.url jdbc:interbase://localhost:3060/C:/firebird/test.gdb

## Pure Java

#hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver
#hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb


## Pointbase

#hibernate.dialect net.sf.hibernate.dialect.PointbaseDialect
#hibernate.connection.driver_class com.pointbase.jdbc.jdbcUniversalDriver
#hibernate.connection.url jdbc:pointbase:embedded:sample
#hibernate.connection.username PBPUBLIC
#hibernate.connection.password PBPUBLIC



#################################
### Hibernate Connection Pool ###
#################################

hibernate.connection.pool_size 0
hibernate.statement_cache.size 0



###########################
### C3P0 Connection Pool###
###########################

#hibernate.c3p0.max_size 2
#hibernate.c3p0.min_size 2
#hibernate.c3p0.timeout 5000
#hibernate.c3p0.max_statements 100
#hibernate.c3p0.validate false



###################################
### Apache DBCP Connection Pool ###
###################################

# connection pool

#hibernate.dbcp.maxActive 100
#hibernate.dbcp.whenExhaustedAction 1
#hibernate.dbcp.maxWait 120000
#hibernate.dbcp.maxIdle 10

## prepared statement cache

#hibernate.dbcp.ps.maxActive 100
#hibernate.dbcp.ps.whenExhaustedAction 1
#hibernate.dbcp.ps.maxWait 120000
#hibernate.dbcp.ps.maxIdle 100

# optional query to validate pooled connections:

#hibernate.dbcp.validationQuery select 1 from dual



#################################
### Plugin ConnectionProvider ###
#################################

## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)

#hibernate.connection.provider_class net.sf.hibernate.connection.DriverManagerConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.DatasourceConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.C3P0ConnectionProvider
#hibernate.connection.provider_class net.sf.hibernate.connection.DBCPConnectionProvider



#######################
### Transaction API ###
#######################

## the Transaction API abstracts application code from the underlying JTA or JDBC transactions

#hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory
#hibernate.transaction.factory_class net.sf.hibernate.transaction.JDBCTransactionFactory


## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI
## default is java:comp/UserTransaction

#jta.UserTransaction jta/usertransaction
#jta.UserTransaction javax.transaction.UserTransaction
#jta.UserTransaction UserTransaction


## to use JTATransactionFactory with JCS caching, Hibernate must be able to obtain the JTA TransactionManager

#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.JBossTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WeblogicTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.OrionTransactionManagerLookup
#hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.ResinTransactionManagerLookup



##############################
### Miscellaneous Settings ###
##############################

## print all generated SQL to the console

#hibernate.show_sql true


## specify a JDBC isolation level

#hibernate.connection.isolation 4


## set the JDBC fetch size

#hibernate.jdbc.fetch_size 25


## set the maximum JDBC 2 batch size (a nonzero value enables batching)

hibernate.jdbc.batch_size 0


## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default)

#hibernate.jdbc.use_scrollable_resultset true


## use streams when writing binary types to / from JDBC

hibernate.jdbc.use_streams_for_binary true


## specify a default schema for unqualified tablenames

#hibernate.default_schema test


## use a custom stylesheet for XML generation (if not specified, hibernate-default.xslt will be used)

#hibernate.xml.output_stylesheet C:/Hibernate/net/sf/hibernate/hibernate-default.xslt


## enable outerjoin fetching (specifying a Dialect will cause Hibernate to use sensible default)

#hibernate.use_outer_join false



############
### JNDI ###
############

## specify a JNDI name for the SessionFactory

#hibernate.session_factory_name hibernate/session_factory


## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;
## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which
## is the best approach in an application server

#file system
#hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
#hibernate.jndi.url file:/

#WebSphere
#hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
#hibernate.jndi.url iiop://localhost:900/



*****************************
My url for database is jdbc:mysql://localhost
*****************************


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 1:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Looks correct - so my guess is that the mysql.jar (or whatever name the .jar is) are not on the classpath.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 1:46 pm 
Newbie

Joined: Sat Sep 20, 2003 1:38 pm
Posts: 10
I do have it in the class path. this is the .bat file

@echo off

rem -------------------------------------------------------------------
rem Execute CodeGenerator tool
rem -------------------------------------------------------------------

set HIBERNATE_HOME=..
set JDBC_DRIVER=%HIBERNATE_HOME%\lib\mm.mysql-2.0.6.jar
set LIB=%HIBERNATE_HOME%\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar

java -cp %CP% net.sf.hibernate.tool.ddl2hbm.Gui


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 1:53 pm 
Newbie

Joined: Mon Sep 08, 2003 12:51 am
Posts: 19
I wonder your MySql version.

I suggest that you go to http://www.mysql.com/ to get suitable jdbc driver for your current MySql server.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 1:57 pm 
Newbie

Joined: Sat Sep 20, 2003 1:38 pm
Posts: 10
I made it easier to see the whole thing by providing a link to the zip folder

http://www.craanhosting.com/hibernate/hibernate-2.0.zip


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 2:05 pm 
Newbie

Joined: Mon Sep 08, 2003 12:51 am
Posts: 19
Anoter problem, your connection url is correct?

Could Hibernate locate at a default database if you do not add the preferred db name?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 2:07 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You have declared two drivers in your properties file:

hibernate.connection.driver_class org.gjt.mm.mysql.Driver
hibernate.connection.driver_class com.mysql.jdbc.Driver

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 2:11 pm 
Newbie

Joined: Sat Sep 20, 2003 1:38 pm
Posts: 10
that fixed it

That was weird


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 2:11 pm 
Newbie

Joined: Mon Sep 08, 2003 12:51 am
Posts: 19
:-)
in your demo.bat, you wrote

set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip
~~~~~~~~ to connect to mysql?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 2:11 pm 
Newbie

Joined: Sat Sep 20, 2003 1:38 pm
Posts: 10
Thank you so much guys


Top
 Profile  
 
 Post subject: Your JDBC url is odd
PostPosted: Sat Nov 22, 2003 2:12 pm 
Regular
Regular

Joined: Sun Sep 21, 2003 11:43 pm
Posts: 85
Location: Massachusetts
Why does your MySQL Jdbc database assignment have no database named? Your format 'jdbc:mysql://localhost ' doesn't match the usual one: 'jdbc:mysql://HOST/DBNAME'. Where are you specifying the database name? You're not even specifying the default schema:
#hibernate.default_schema test

Regards,
David

P.S. I'm going to look at your download but I'm on a momen so downloading everything you put up there is taking a while.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2003 2:22 pm 
Newbie

Joined: Mon Sep 08, 2003 12:51 am
Posts: 19
Two points:

in demo.bat

set JDBC_DRIVER=lib\mm.mysql-2.0.6.jar
java -cp src;build;%JDBC_DRIVER%;lib\commons-logging.jar;lib\commons-collections.jar;lib\commons-beanutils.jar;lib\commons-lang.jar;lib\cglib.jar;lib\bcel.jar;lib\odmg.jar;lib\jdom.jar;lib\xml-apis.jar;lib\xerces.jar;lib\xalan.jar;hibernate.jar net.sf.hibernate.eg.NetworkDemo

in hibernate.properties

## MySQL

hibernate.dialect net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class org.gjt.mm.mysql.Driver
#hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql:///yourdb
hibernate.connection.username your_account
hibernate.connection.password your_password


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 15 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.