-->
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.  [ 3 posts ] 
Author Message
 Post subject: [TIPS] MySQL / Eclipse / Hibernate
PostPosted: Mon Aug 01, 2005 8:30 am 
Newbie

Joined: Mon Aug 01, 2005 7:47 am
Posts: 3
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 !


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 9:23 am 
Newbie

Joined: Mon Aug 01, 2005 7:47 am
Posts: 3
for of all i was going to post a question ; as i'm a total n00b ; but as i read some other links (http://www.hibernate.org/152.html) i found the solution and put "[TIPS]" in the subject ;)

regards.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 9:25 am 
Newbie

Joined: Mon Aug 01, 2005 7:47 am
Posts: 3
foxmask wrote:
for of all i was going to post a question ; as i'm a total n00b ; but as i read some other links (http://www.hibernate.org/152.html) i found the solution and put "[TIPS]" in the subject ;)

regards.

s/for of all/first of all/

(need to sleep)


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