what is the name of the database to be created and selected (for the Events tutorial) in the mySQL connection settings? Is there somewhere else to put the name into the build configuration?
The Events Tutorial database setup doesn't specify a database name in the connection configuration template. This works for hsqldb, but mySQL needs a database name specification, as shown by the error:
Caused by: java.sql.SQLException: No database selected
I have tried specifying "test" as a database name, but that doesn't work - it says it doesn't exist which is true.
Hibernate connected to mySQL successfully in installation test Auction app. see below. Also I have successfully done the Events tutorial once through completely using hsqldb. The second time through I want to do it with mySQL.
Notes:
Settings:
mysql in the "Day 1" test portion of the tutorial (auction app) from URL:
http://www.hibernate.org/152.html, with the following settings for hibernate.properties:
hibernate.dialect org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://localhost:3306/test
hibernate.connection.username gavin
hibernate.connection.password
but then later the instructions won't work for mysql...
On the "Day 2" section (
http://www.hibernate.org/hib_docs/v3/re ... orial.html) the hsqldb connection setting works properly without specifying database name. the mysql connection setting needs a database name, shown by my hibernate output error:
Caused by: java.sql.SQLException: No database selected
Needs database name:
mysql setting:
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<property name="connection.pool_size">1</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
These analogous settings work with hsqldb:
hsqldb connection setting:
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="connection.url">jdbc:hsqldb:hsql://localhost</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<property name="connection.pool_size">1</property>
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>