Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about PreparedStatement

 
jeff mutonho
Ranch Hand
Posts: 271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a generated persister class(eg in my case EJSJDBCPersisterCMPSystemSettingsEjbBean_3bae2ca5.java) ,if I'm degubbing , how do I get to see the values inserted into a query for a finder method such as the one shown below

public EJSFinder findByName(java.lang.String name) throws javax.ejb.FinderException, java.rmi.RemoteException {
ResultSet resultSet = null;
PreparedStatement pstmt = null;
try {
preFind();
pstmt = getPreparedStatement("SELECT T1.SYSTEM_SETTINGS_ID, T1.VALUE, T1.NAME FROM CBPTR1.CBPT_SYSTEM_SETTINGS T1 WHERE T1.NAME = ? ORDER BY T1.VALUE");
if (name == null) {
pstmt.setNull(1, java.sql.Types.VARCHAR);
} else {
pstmt.setString(1, name);
}
resultSet = pstmt.executeQuery();
return new EJSJDBCFinder(resultSet, this, pstmt);
}
catch (Exception ex) {
throw new EJSPersistenceException("find failed:", ex);
}
}

In other words , how do I view the finally generated select statement, the actual query being executed against my datastore?

jeff mutonho
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic