Hi,
When setting up a JDBC connection in a J2EE application, do you need to specify the schema name in addition to the database name?
I have followed this tutorial and have setup a database, and username/password, but I'm coming up against this error when I startup my application. Is it possible that DBUnit is trying to insert the data, before hibernate has initiated and created the schema?
Caused by: org.dbunit.dataset.NoSuchTableException: Did not find table 'CLIENT' in schema 'null'
My connection details are as follows :
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://127.0.0.1:3306/salestracker"/>
<property name="username" value="salestracker"/>
<property name="password" value="salestracker"/>
</bean>
I have created the database :
[james@nevada sales-tracker]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.1.42 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| salestracker |
| test |
+--------------------+
4 rows in set (0.00 sec)
Do I need to specify something in my hibernate persistence.xml that says to "use" a particular database? I was assuming this would be implied in the JDBC URL