[Opensource] JDBCExcecutor Design

larry hamel expresso at codeguild.com
Wed Dec 11 17:47:33 PST 2002


Peter,

the prepared statement is stored in a data member within the connection on line 278 of my copy.
                                java.sql.PreparedStatement prepStatement = myConnection.createPreparedStatement(theSqlCommand);

that stored statement is executed during the

>                                myConnection.executeUpdate(null);

that you quoted.

the commented out lines appear to be old garbage.

larry


At 10:49 AM 12/11/2002, you wrote:
>Hi
>
>I got a stack trace in `JDBCExecutor.java'?
>
>2002-12-10 23:35:24,550 ERROR [Thread-13] jdbc.JDBCExecutor (JDBCExecutor.java:314) - com.jcorporate.expresso.core.dataobjects.jdbc.JDBCExecutor.add(DataObject) error
>com.jcorporate.expresso.core.db.DBException: Unable to execute statement: null(com.jcorporate.expresso.core.dataobjects.jdbc.JDBCExecutor, db/context 'default'):Error during query: Unexpected Exception: java.sql.SQLException message given: Invalid argument value: Duplicate entry 'Summary-3' for key 1
>        at com.jcorporate.expresso.core.db.DBConnection.executeUpdate(DBConnection.java:943)
>        at com.jcorporate.expresso.core.dataobjects.jdbc.JDBCExecutor.add(JDBCExecutor.java:298)
>        at com.jcorporate.expresso.core.dbobj.DBObject.add(DBObject.java:632)
>        at com.jcorporate.expresso.core.dbobj.SecuredDBObject.add(SecuredDBObject.java:342)
>        at com.jcorporate.econtent.dbobj.ResourceLog.add(ResourceLog.java:112)
>        at com.jcorporate.econtent.util.ResourceLogHandler.checkQueue(ResourceLogHandler.java:114)
>        at com.jcorporate.econtent.util.ResourceLogHandler.run(ResourceLogHandler.java:161)
>Stopping service Tomcat-Standalone
>
>
>When I look inside the source code. I can see that JDBCExecutor.java
>at around 298 will never execute any sort of SQL prepared statement.
>It is ALWAYS going to be `null'!
>
>                               }
>                                myConnection.executeUpdate(null);
>                                myConnection.clearPreparedStatement();
>
>                        } else {
>                                myConnection.executeUpdate(theSqlCommand);
>                        }
>
>Why is there a section of code commented out? What can I do?
>
>
>-- 
>Peter Pilgrim
>ServerSide Java Specialist
>
>My on-line resume and for interview videos about myself, J2EE
>Open Source, Struts and Expresso.
>   ||
>   \\===>  `` http://www.xenonsoft.demon.co.uk/no-it-striker.html ''
>
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/




More information about the Opensource mailing list