0

I have set hbm2dll.auto property to create in my configuration file.

<property name="hibernate.hbm2ddl.auto">create</property>

Whenever I create SessionFactory it drops the table if already created but it is not recreating the table causing my program termination with this exception:

java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

Is it because of some database permission issue? I am using Oracle 11g as databse.

UPDATE: Hibernate configuration file

<?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.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@host:port:database</property>
        <property name="hibernate.connection.username">username</property>
        <property name="hibernate.connection.password">password</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
        <property name="hibernate.default_schema">myschema</property>
        <property name="show_sql">true</property>
        <property name="hibernate.hbm2ddl.auto">create</property>
        <mapping class="com.vat.annot.user.DBUser"></mapping>

    </session-factory>
</hibernate-configuration>
vatsal mevada
  • 5,148
  • 7
  • 39
  • 68
  • I think my problem is different. My program is working fine if I manually create table and then insert data without setting hbm2ddl.auto to create. The issue is that hibernate is not creating table automatically. – vatsal mevada Dec 03 '14 at 12:09
  • 1
    Kindly post your java code which has connections details part to connect to your database schema – Naghaveer R Dec 03 '14 at 12:53
  • 1
    @user123: Added configuration file in question. – vatsal mevada Dec 03 '14 at 13:14

0 Answers0