Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version (tools for eclipse):
hibernate 3.0 beta4
Mapping documents:
-none-
Code between sessionFactory.openSession() and session.close():
-none-
Full stack trace of any exception that occurs:
Name and version of the database you are using:
# mysql -V
mysql Ver 12.22 Distrib 4.0.24, for pc-linux-gnu (i386)
The generated SQL (show_sql=true):
-non-
Debug level Hibernate log excerpt:
i'm using the hibernate tools plugins for eclipse. (as already said)
and i'm following the flash demo here
http://www.hibernate.org/255.html
but when i do "hibernate artifact generation" i got the following error :
org.hibernate.exception.GenericJDBCException: Getting database metadata
here is the hibernate.cfg.xml i made by the "hibernate configuration file"
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/infradb</property>
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.connection.password">root</property>
<property name="hibernate.connection.username">r00t</property>
<property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
</session-factory>
</hibernate-configuration>
when i try to connect to the database on the command lines ; everything is ok i can connect to
Code:
# mysql -u root -p infradb
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 388 to server version: 4.0.24_Debian-10-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
when i use hibernate in standalone and launch the ant eg with another database all goes well.
but if i change to infradb/infrauser/infrapass this time i see a connection error because of the host access.
so i had to grant privileges to infrauser@my_hostname_machin and not just to @localhost.
then when i go back to eclipse and retry the "artifact" all go well !!!
And without changing anithing about the uri jdbc:mysql://localhost:3306/infradb !