I'm new to hibernate, and i'm unclear about the error i'm recieving
i have my hibernate.properties set up properly(i can retrieve them from the Configuration object through a little routine i set up), and my JDBC drivers are in the correct path. the error occurs at this line of code
i've read the hibernate documentation, and i'm reading 'Hibernate in Action', but i'm obviously missing something. can anyone give me a hint?
I am working on hibernate and was able to make it working. I didnt get your problem clearly. If you could explain me I will help you
Oracle Certified Enterprise Architect (Part 1);SUN Certified Programmer;SUN Certified Business Component Developer;SUN Certified Web Component Developer;
Oracle Certified WebServices Developer;Oracle Certified Java Persistence API Developer;Oracle Certified SQL Expert;IBM Certified XML Solution Developer
Joined: May 22, 2004
Hi, thanks for your response. The problem i'm having is with the following section of code
This is just a test that i'm running in order to learn Hibernate. Instead of using the 'hibernate.hbm.xml' file, i'm using the 'hibernate.properties' to set my parameters. When i run the test, i get the error that i specified in my orginal post. However, if i run the code by placing a java.sql.Connection object as a parameter of sessions.openSession, the code works. My question is this: shouldn't the parameters of the 'hibernate.properties' be good enough to set up a connection to the database when i create a Configuration object?
I am new to Hibernate as well and I had the same error message. If you load your properties directly from your hibernate.properties file, your code fragment should work. So if your properties file is in the PROPS_DIR directory then something like:
Properties props = new Properties(); props.load(new FileInputStream("PROPS_DIR/hibernate.properties")); Configuration cfg = new Configuration(); cfg.setProperties(props);
Configuration cfg = new Configuration(); cfg.setProperties(System.getProperties());
should work. Other than that, I can only think that you are not passing all hibernate properties to the system. Have you checked System.getProperties() to see if all the Hibernate properties that you are passing to the JVM are there ?