I have installed DB2 on my local machine and created a table Users with a column Name.
From my portlets I am executing a simple select statement:
Class.forName("com.ibm.db2.jcc.DB2Driver");
String dburl = "jdbc:db2://localhost:50001/Portlets";
conn = DriverManager.getConnection(dburl,"db2admin","password");
String selectTableSQL = "SELECT Name from Users";
statement = conn.createStatement();
ResultSet rs = statement.executeQuery(selectTableSQL);
when i execute this i get the following exception:
com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.USERS, DRIVER=3.62.56.
I dont understand why I am getting this exception. There is nothing much in the stack trace as well.