users@glassfish.java.net

mysql - rmi access of datasource = access denied

From: <glassfish_at_javadesktop.org>
Date: Thu, 10 Jan 2008 01:00:56 PST

Hi

This might be a jdbc problem rather then glassfish but i have a strange problem with a datasource connected to mysql.

The connection works, i can ping it. It works locally (Hibernate) and i can insert, update and so forth.

But then i tried to do a rmi lookup of the datasource from the IDE.I get the datasource but then i get "java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Access denied for user 'nnn'@'localhost' (using password: YES)"

The code is simply:

      Object o = ctx.lookup("jdbc/...");
      DataSource ds = (DataSource) o;
      Connection con = ds.getConnection();
      Statement st = con.createStatement();
      ResultSet res = st.executeQuery("SELECT * FROM ");

So it seems to do something differently when i access it using rmi. Is there anyone else here that perhaps have had this problem and knows how to solve it ?

/Laban
[Message sent by forum member 'laban' (laban)]

http://forums.java.net/jive/thread.jspa?messageID=253148