This happens when I try to use the java code:
PreparedStatement pstmt = con.prepareStatement("Select * From USER_ROLE, ROLE" +
"WHERE USER_ROLE.USERID = ? And USER_ROLE.ROLEID = ROLE.ID");
pstmt.setInt(1, id);
ResultSet rs = pstmt.executeQuery();
If i execute the same query at mysql prompt, it works perfectly fine as is. Is their a problem with the JDBC driver ?
Thanks.
The error thrown is:
java.sql.SQLException: Invalid argument value, message from server: "Not unique table/alias: 'USER_ROLE'"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1613)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:880)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:939)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1780)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:143 9)
--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php