Cheung Brian
Cheung Brian

Reputation: 755

Glassfish JDBC: Do I have to use only jdbc/__default?

I try to use Glassfish/MySQL. I have created JDBC resource and JDBC connection pool for MySQL.

But if I tried to put MySQL JDBC resource in jta-data-source, nothing works.

Then if I tried to modify jdbc/__default and change its connection pool from DerbyPool to MySQL, it works. My entity gets persists to the correct table.

So do I have to use jdbc/__default only as my JDBC resource for my app? How can I use the JDBC resource and JDBC connection pool I created in my app?

I really have hard time understanding how to use JDBC in Glassfish.

This is my first time to ask question in this forum. Thank you very much.

Upvotes: 2

Views: 2275

Answers (1)

Namphibian
Namphibian

Reputation: 12221

See this link for a step by step tutorial on how to create JDBC connection pools in Glassfish server. Here is the official documentation on how to do it. Or you can read this SO question. And another resource that you can use is this SO question.

Upvotes: 1

Related Questions