-->
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: JPA,Insert
PostPosted: Mon Oct 29, 2007 8:13 am 
Newbie

Joined: Wed Oct 24, 2007 12:31 am
Posts: 3
I got the following error while inserting a record in DB.Please help me about am new to JPA.

em.getTransaction().begin();/// i got exception at this line
em.persist(customer);
em.getTransaction().commit();

Exception Caught in Hibernate Util: java.lang.UnsupportedOperationException: The user must supply a JDBC connection

My persistence xml is ...

<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="sample">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.sample.jpa.Customer</class>
<class>com.sample.jpa.Order</class>
<properties>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:XE</property>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">tiger</property>
<property name="hibernate.show_sql">true</property>
</properties>
</persistence-unit>
</persistence>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 29, 2007 3:50 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
use hibernate.connection.* instead of connection.*

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 31, 2007 5:09 am 
Newbie

Joined: Wed Oct 24, 2007 12:31 am
Posts: 3
Thx emmanual.Its working fine now :-)


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.