During the boot process for my application, I check for the existence of database tables and create them if they don't exist. To do this, I look up the data source's connection pool via JNDI and then I issue a SELECT COUNT(*) FROM MYTABLE query.
When I execute this code on NetWeaver Java EE 5, a stack trace is emitted to the log whenever a table isn't found. Since this isn't an error in my case, I don't want a stack trace to be issued. It's particularly disconcerting if 20 - 30 stack traces are issued, one per table.
It appears that the stack trace is issued by NetWeaver JDBC code before my application is afforded the opportunity to handle the exception. I've tried the same code on another application server and confirmed that the stack trace isn't emitted by the database driver so it must be NetWeaver that's doing so.
Is there any way to have NetWeaver suppress stack traces for JDBC exceptions?
Thanks,
Jerry
#com.sap.sql.jdbc.direct.DirectPreparedStatement#sap.com/DSTestEAR#com.sap.sql.jdbc.direct.DirectPreparedStatement#Guest#0#####HTTP Worker [0]##0#0#Error#1#/System/Database/sql/jdbc/direct#Java#sap.com.sql.3[C0000A12B3AA000000000094017B51E800041735501B7588]##SQL error occurred on connection : code={0,number,integer}, state="", message="";
nSQL statement is "".
[EXCEPTION]
#6#208#S0002#Invalid object name 'NOSUCHTABLE'.#MYSERVER:NetWeaver:dbo#SELECT COUNT(*) FROM NOSUCHTABLE#com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'NOSUCHTABLE'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.sendExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteQuery(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
at com.sap.sql.jdbc.basic.BasicPreparedStatement.executeQuery(BasicPreparedStatement.java:99)
at com.sap.sql.jdbc.direct.DirectPreparedStatement.executeQuery(DirectPreparedStatement.java:307)
at com.sap.sql.jdbc.direct.DirectPreparedStatement.executeQuery(DirectPreparedStatement.java:264)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:274)
...