hi here,
I'm tyring to connect to a local mysql db using hibernate;
I can connect to the same db using the java JDBC api with :
Class.forName("com.mysql.jdbc.Driver").newInstance();
DriverManager.getConnection("jdbc:mysql:///marker" + "?socketFactory=com.mysql.jdbc.NamedPipeSocketFactory", "root", "boo10rad");
I have been able to connect to oracle on an external server using hibernate and last summer to my local mysql using hibernate.
I'm presuming that somewhere something has changed but what ?
is there a clue in that using JDBC requires the socketFactory?
the hibernate.cfg file has the correct driver_class, correction_url, and dialect; the driver and hibernate jars are on the classpath.
thank you for any assistance that you may be able to provide.
Brian
the output is:
Jan 19, 2008 3:23:29 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.4.sp1
Jan 19, 2008 3:23:30 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Jan 19, 2008 3:23:30 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
Jan 19, 2008 3:23:30 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Jan 19, 2008 3:23:30 PM org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
Jan 19, 2008 3:23:30 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
Jan 19, 2008 3:23:31 PM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : \Book.hbm.xml
Jan 19, 2008 3:23:32 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: ca.deeds.utoronto.userxx.hibernate.Book -> books
Jan 19, 2008 3:23:32 PM org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
Jan 19, 2008 3:23:32 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
Jan 19, 2008 3:23:32 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
Jan 19, 2008 3:23:32 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: true
Jan 19, 2008 3:23:33 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/marker
Jan 19, 2008 3:23:33 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=root, password=****, autocommit=true}
Jan 19, 2008 3:23:34 PM org.hibernate.cfg.SettingsFactory buildSettings
WARNING: Could not obtain connection metadata
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying except
:
** BEGIN NESTED EXCEPTION **
java.net.ConnectException
MESSAGE: Connection refused: connect
STACKTRACE:
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
.......
|