Netbeans Glassfish Server Connection Pools to MySQL Schemas
Posted by: D C
Date: May 20, 2014 08:32PM

I wanted to learn how to code a database web service for mobile clients. I downloaded, setup and ran all the latest versions of Netbeans, MySQL and Glassfish Server on my Macbook Pro running OS X 10.9.3. I googled and found some sample Java web service code to learn the basics. I setup some tables in MySQL and added some rows of data. The problem seems to boil down to how the Netbeans Glassfish server Java connection pool interacts with the MySQL database server. After many hours of trial and error and endless googling, I learned that the user setup in the connection pool dictates the default schema that can be accessed in the MySQL database. I setup a new user account in MySQL and created a Schema of the same name as the user and populated it with some data. I created a new connection pool with this user name and password and the url with the database (schema) name. Using the MySQLWorkBench I granted this user every possible right to the schema. The end result is that the any sql in the web service using this connection pool cannot see any of the schemas setup in Workbench, including the user specific one. If I run create tables sql in the web service, it either uses the APP schema or seems to use some parallel schema of the same name as the user, but the tables do not show up in workbench. It is like the workbench schemas and the connection pool schemas are in two different worlds that don't see each other. Using other database connections (not pools) in either the Netbeans Services IDE or from a client Java application works perfectly with no issues. It seems to be a connection pool specific issue. I have triple checked the connection pool and MySQL setups as far as users, passwords, schema rights, etc. I would really like to get this work but don't know how to troubleshoot this anymore. Any help greatly appreciated.

Options: ReplyQuote


Subject
Written By
Posted
Netbeans Glassfish Server Connection Pools to MySQL Schemas
D C
May 20, 2014 08:32PM


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.