Alejandro Barrero wrote:Thanks again. What I am doing is
I know that there is a connection. The line "ResultSet result = statement.executeQuery(selectStatement);" gets executed and throws an exception with the error "No database selected".
I remember reading that this is a problem with MySQL and the solution was to somehow set the database. Unfortunately, "statement.execute("USE MySQL");" is giving me errors. This is happening in a MySQL connection pool and somebody knows the answer.
But you use MySQ in stead of MySQL:
Alejandro Barrero wrote:Thank you Jan. I access the database in DbVisualiser with"jdbc:mysql://localhost:3306/MySQL". DbVisualiser shows "MySQL" as the root and node "mysql" contains the tables. In the GlassFish administrator console I created the connection pool with "DatabaseName" as "mysql" and I used "jdbc:mysql://localhost:3306/MySQL" as "url". "jdbc/paperles" is the name of the JDBC Resource in GlassFish.
but I have the database name in the URL "jdbc:mysql://localhost:3306/MySQ"