Update to Netbeans Glassfish Server Connection Pools to MySQL Schemas
Posted by: D C
Date: May 21, 2014 06:09PM

The problem was that the connection pool resource to the mySQL database that was setup and referenced in my web service was not being used. It was defaulting to the built in Derby connection pool and all of the tables and data were being created in the Java DB Derby database. I double checked the settings in the connection pool I had setup and could not determine the problem. As an interim solution, I hijacked the built-in Derby connection pool by changing the database connection class to mySQL and changing the parameters to point to the MySQL database. This worked. Would anyone have suggestions on how I could troubleshoot why the connection pool I setup for mySQL is not being used or not working — are there any log files that may contain error messages on the connection pool for Glassfish server? Am I missing a critical configuration file? Thank you for any assistance.

This is my web service data connection code:

In my original code, the resource name was “jdbc/connectionpool1” — behind the scenes, it was not using connectionpool1 but the DerbyPool instead.

@WebService
public class NewWebServiceCalc
{
@Resource(name = "jdbc/DerbyPool")
private DataSource DerbyPool;
public Connection con;

@WebMethod
public String Add(@WebParam(name="a") String a,
@WebParam(name="b") String b) throws SQLException
{

try {

con = DerbyPool.getConnection("user1", “xxxxx”);

Options: ReplyQuote


Subject
Written By
Posted
Update to Netbeans Glassfish Server Connection Pools to MySQL Schemas
D C
May 21, 2014 06:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.