cannot select db in jdbc url
Posted by: info
Date: May 20, 2005 11:28PM

hi to all,

when i call getConnection() using the following code

    DBConnector connector = DBConnector.getInstance();
    Connection conn = null;
    try {
      Class.forName("com.mysql.jdbc.Driver").newInstance();
      conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/", "group", "");
      //conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/xns" , "group", "");
    } catch(Exception e) {
      // TODO: add logging here
      out.write(e.getMessage());
      e.printStackTrace();
    }

i connect to the database, but if i use the getConnection() line that is commented, i get NPE for the Connection object.

this means all my queries have to be in the form

SELECT something FROM database.table;

any ideas ?

MySQL = v4.1.10-nt
JDBC = latest GA --> http://dev.mysql.com/downloads/connector/j/3.1.html


kind regards,

g00fy

Options: ReplyQuote


Subject
Written By
Posted
cannot select db in jdbc url
May 20, 2005 11:28PM


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.