Skip to main content

Database Connection not working in my application

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
haukeg
Offline
Joined: 2007-08-28

Hello everyone,

I am coming from jboss and there it was kind of easy to install the database connection for my enterprise application.

I followed the instructions from this site
http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-glassfish-...

and everything seems to be ok. The ping is also working.

Then I created the persistence.xml inside my ejb project under META-INF
with this content:

<?xml version="1.0" encoding="UTF-8"?>

xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">

jdbc/houseautomation

But when I start the server, nothing happens. On Jboss the tables will be created. I don't get any errors or exceptions but also nothing happens.

Did I forget something?

I am not quite sure about the name:

jdbc/houseautomation

Inside glassfish I named it also jdbc/houseautomation. Do I need to add a prefix like java: ? I tried that also without any luck.

Many greetings,
Hauke

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
haukeg
Offline
Joined: 2007-08-28

Hey myself,

Now I also tried to create the JDBC connection pool once with Resource Type java.sql.driver and once with javax.sql.DataSource.

Both pings are working but still there will no table be created.

Next I will try to create an entity manager. Shouldn't glassfish say something about the jdbc connection url on the server.log ?

Greetings,
hauke