-->
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: ERROR - could not get database metadata
PostPosted: Mon Nov 27, 2006 5:50 am 
Newbie

Joined: Thu Nov 23, 2006 1:49 am
Posts: 4
Hi .. when i were executed one simple program that try to storing data in one EVENTS table..and successfully insertion trasaction is done

config: IDE:Eclipse
DB:Hsql
app: non manages app.(commandline program)
But i got following error in my console!!


INFO - using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://localhost/test
INFO - connection properties: {user=sa, password=****}
INFO - Running hbm2ddl schema update
INFO - fetching database metadata
ERROR - could not get database metadata
java.sql.SQLException: Table not found in statement [select sequence_name from system_sequences]
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.executeQuery(Unknown Source)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences(DatabaseMetadata.java:113)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:39)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:124)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:252)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
at de.gloegl.road2hibernate.HibernateUtil.<clinit>(HibernateUtil.java:13)
at de.gloegl.road2hibernate.EventManager.store(EventManager.java:50)
at de.gloegl.road2hibernate.EventManager.main(EventManager.java:20)
ERROR - could not complete schema update
java.sql.SQLException: Table not found in statement [select sequence_name from system_sequences]
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.executeQuery(Unknown Source)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences(DatabaseMetadata.java:113)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:39)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:124)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:252)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
at de.gloegl.road2hibernate.HibernateUtil.<clinit>(HibernateUtil.java:13)
at de.gloegl.road2hibernate.EventManager.store(EventManager.java:50)
at de.gloegl.road2hibernate.EventManager.main(EventManager.java:20)
INFO - cleaning up connection pool: jdbc:hsqldb:hsql://localhost/test
INFO - Checking 0 named queries
INFO - cleaning up connection pool: jdbc:hsqldb:hsql://localhost/test
Hibernate: insert into EVENTS (date, eventtitle, uid) values (?, ?, ?)

...pls needfully suggestion me!!!
javaAmtho!!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 27, 2006 7:42 am 
Regular
Regular

Joined: Sat May 20, 2006 3:49 am
Posts: 78
could you please post your mapping file and the POJO of that table?


Top
 Profile  
 
 Post subject: could not get database metadata
PostPosted: Mon Nov 27, 2006 8:53 am 
Newbie

Joined: Thu Nov 23, 2006 1:49 am
Posts: 4
XML File:

<hibernate-mapping>

<class name="de.gloegl.road2hibernate.Event" table="EVENTS">
<id name="id" column="uid" type="long">
<generator class="increment"/>
</id>
<property name="date" type="timestamp"/>
<property name="title" column="eventtitle"/>

<set name="participatingUsers" table="participations">
<key column="event_uid"/>
<many-to-many column="user_uid" class="de.gloegl.road2hibernate.User"/>
</set>
</class>

</hibernate-mapping>


JavaFile:

package de.gloegl.road2hibernate;

import java.util.Date;
import java.util.Set;
import java.util.HashSet;

public class Event {
private String title;
private Date date;
private Long id;
private Set participatingUsers = new HashSet();

protected Set getParticipatingUsers() {
return participatingUsers;
}

protected void setParticipatingUsers(Set newParticipatingUsers) {
participatingUsers = newParticipatingUsers;
}

public void addParticipant(User user) {
participatingUsers.add(user);
user.getEventsJoined().add(this);
}

public void removeParticipant(User user) {
participatingUsers.remove(user);
user.getEventsJoined().remove(this);
}

private Long getId() {
return id;
}

private void setId(Long id) {
this.id = id;
}

public Date getDate() {
return date;
}

public void setDate(Date date) {
this.date = date;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}
}


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.