Hello Everyone:
I'm new using hibernate in my JAVA applications, and I was developing a Simple Console application using Oracle 10g Express Edition.
I've configured my hibernate.cfg.xml with these properties:
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.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:XE</property>
<property name="hibernate.connection.username">MainUserEvent</property>
<property name="hibernate.connection.password">abc123</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
</session-factory>
</hibernate-configuration>
My problem comes when I begin a transaction, I receive a SQLExeception telling me that password parameter is null and the login was deined.
This is the code when I catch the exception:
Code:
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();//In this line I receive the exception
Event theEvent = new Event();
theEvent.setTitle(title);
theEvent.setDate(theDate);
session.save(theEvent);
session.getTransaction().commit();
So, viewing this xml, Could anyone tell me why this happens?
Thanks.