Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about PreparedStatement

 
Ranch Hand
Posts: 271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic