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.  [ 1 post ] 
Author Message
 Post subject: Native generator throw an Exception when session.save()
PostPosted: Thu Jan 20, 2005 11:32 pm 
Newbie

Joined: Fri Aug 20, 2004 11:48 am
Posts: 7
I do the mapping for CDR using native generator.

However, it has throw an Exception when session.save(cdr).

Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1"

java.lang.AbstractMethodError: com.mysql.jdbc.jdbc2.Connection.prepareStatement

(Ljava/lang/String;I)Ljava/sql/PreparedStatement;
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache$2.run(GooGooStatementCache.java:325)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run

(ThreadPoolAsynchronousRunner.java:148)


mysql> desc cdr
-> ;
+-------------+-------------+------+-----+---------------------+----------------
+
| Field | Type | Null | Key | Default | Extra
|
+-------------+-------------+------+-----+---------------------+----------------
+
| CdrID | int(11) | | PRI | NULL | auto_increment
|
| AccessTime | datetime | | | 0000-00-00 00:00:00 |
+-------------+-------------+------+-----+---------------------+----------------


public class CDR{
private long cdrID;
private java.util.Date accessTime;

public CDR(){}

public long getCdrID() {
return cdrID;
}

public void setCdrID(long cdrID) {
this.cdrID = cdrID;
}

public java.util.Date getAccessTime() {
return accessTime;
}

public void setAccessTime(java.util.Date accessTime) {
this.accessTime = accessTime;
}
}

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"

"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.mobileserver.CDR" table="cdr">
<id name="cdrID">
<generator class="native"/>
</id>
<property name="accessTime" column="accesstime" type="timestamp" length="19" not-null="true"/>
</class>
</hibernate-mapping>


Hibernate version: 2.1.6
Mysql server version: 4.0.22-nt
JDBC Connection: mysql-connector-java-2.0.14-bin.jar
Windows Platform: WinXP

who can help me solution the problem? Thank you! ^^


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.