Based on the stack traces you sent this may be an issue with the
PostgresSQL JDBC driver.
Try setting a null date value using the JDBC API directly (not with
the JDBCControl) and see if you get the same error. If that's the
case then it is an issue with the PostgresSQL JDBC driver.
- Chad
On 7/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi Chad,
> The errors were different in the different cases.
>
> I am providing the requested information:
>
> Kind regards:
> al_shopov
>
> 1. I am using Beehive 1.0.2
> 2. PostgresSQL 8.2
> 3. Sun JDK 1.5
> 4. apache-tomcat-5.5.23
> 5. JDBC driver - postgresql-8.1-408.jdbc3.jar
>
> Relevant JDBC control source:
> -----------------------------
> @SQL(statement="insert into test (id, date) values ({id}, {date})")
> public void insertIntoTestString(int id, String date);
>
> @SQL(statement="insert into test (id, date) values ({id}, {d
> {date}})")
> public void insertIntoTestStringEscaped(int id, String date);
>
> @SQL(statement="insert into test (id, date) values ({id}, {date})")
> public void insertIntoTestDate(int id, Date date);
>
> @SQL(statement="insert into test (id, date) values ({id}, {d
> {date}})")
> public void insertIntoTestDateEscaped(int id, Date date);
>
> Relevent Controller source:
> ------------------------------
> @Jpf.Action(forwards = { @Jpf.Forward(name = "success", path =
> "showDates.jsp")})
> public Forward processDate(){
> int i = invoiceControl.getMaxIdTest();
>
>
> java.sql.Date nullDate = null;
> String emptyString = "";
> String nullString = null;
>
> i++;
> try {invoiceControl.insertIntoTestDate(i, nullDate);}
> catch (Exception e) {log.error("insertIntoTestDate -
> nullDate", e);}
>
> i++;
> try {invoiceControl.insertIntoTestDateEscaped(i, nullDate);}
> catch (Exception e) {log.error("insertIntoTestDateEscaped
> - nullDate", e);}
>
> i++;
> try {invoiceControl.insertIntoTestString(i, nullString);}
> catch (Exception e) {log.error("insertIntoTestString -
> nullString", e);}
>
> i++;
> try {invoiceControl.insertIntoTestStringEscaped(i,
> nullString);}
> catch (Exception e) {log.error("insertIntoTestStringEscaped -
> nullString", e);}
>
> i++;
> try {invoiceControl.insertIntoTestString(i, emptyString);}
> catch (Exception e) {log.error("insertIntoTestString -
> emptyString", e);}
>
> i++;
> try {invoiceControl.insertIntoTestStringEscaped(i,
> emptyString);}
> catch (Exception e) {log.error("insertIntoTestStringEscaped -
> emptyString", e);}
>
>
> Map[] m = invoiceControl.getAllDates();
> Forward f = new Forward("success");
> f.addActionOutput("list", m);
> return f;
> }
>
> Relevant log messages, I've cut out some of the stactrace and have substituted
> with .... ....:
> --------------------------------
>
> 2007-07-18 13:57:50,314 ERROR esign.invoices.admin.Controller -
> insertIntoTestDate - nullDate
> java.lang.reflect.UndeclaredThrowableException
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestDate(InvoiceControlBean.java:249)
> at esign.invoices.admin.Controller.processDate(Controller.java:244)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> .... ....
> Caused by: org.postgresql.util.PSQLException: ERROR: column "date" is of type
> date but expression is of type character varying
> at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:347)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.execPreparedStatement(JdbcControlImpl.java:290)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.invoke(JdbcControlImpl.java:224)
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestDate(InvoiceControlBean.java:234)
> ... 41 more
>
> 2007-07-18 13:57:50,317 ERROR esign.invoices.admin.Controller -
> insertIntoTestDateEscaped - nullDate
> java.lang.reflect.UndeclaredThrowableException
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestDateEscaped(InvoiceControlBean.java:405)
> at esign.invoices.admin.Controller.processDate(Controller.java:248)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> .... ....
> Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near
> "$2"
> at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:347)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.execPreparedStatement(JdbcControlImpl.java:290)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.invoke(JdbcControlImpl.java:224)
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestDateEscaped(InvoiceControlBean.java:390)
> ... 41 more
>
> 2007-07-18 13:57:50,320 ERROR esign.invoices.admin.Controller -
> insertIntoTestString - nullString
> java.lang.reflect.UndeclaredThrowableException
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestString(InvoiceControlBean.java:524)
> at esign.invoices.admin.Controller.processDate(Controller.java:252)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> .... ....
> Caused by: org.postgresql.util.PSQLException: ERROR: column "date" is of type
> date but expression is of type character varying
> at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:347)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.execPreparedStatement(JdbcControlImpl.java:290)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.invoke(JdbcControlImpl.java:224)
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestString(InvoiceControlBean.java:509)
> ... 41 more
>
> 2007-07-18 13:57:50,323 ERROR esign.invoices.admin.Controller -
> insertIntoTestStringEscaped - nullString
> java.lang.reflect.UndeclaredThrowableException
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestStringEscaped(InvoiceControlBean.java:368)
> at esign.invoices.admin.Controller.processDate(Controller.java:256)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> .... ....
> Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near
> "$2"
> at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:347)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.execPreparedStatement(JdbcControlImpl.java:290)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.invoke(JdbcControlImpl.java:224)
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestStringEscaped(InvoiceControlBean.java:353)
> ... 41 more
>
> 2007-07-18 13:57:50,327 ERROR esign.invoices.admin.Controller -
> insertIntoTestString - emptyString
> java.lang.reflect.UndeclaredThrowableException
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestString(InvoiceControlBean.java:524)
> at esign.invoices.admin.Controller.processDate(Controller.java:260)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> .... ....
> Caused by: org.postgresql.util.PSQLException: ERROR: column "date" is of type
> date but expression is of type character varying
> at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:347)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.execPreparedStatement(JdbcControlImpl.java:290)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.invoke(JdbcControlImpl.java:224)
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestString(InvoiceControlBean.java:509)
> ... 41 more
>
> 2007-07-18 13:57:50,343 ERROR esign.invoices.admin.Controller -
> insertIntoTestStringEscaped - emptyString
> java.lang.reflect.UndeclaredThrowableException
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestStringEscaped(InvoiceControlBean.java:368)
> at esign.invoices.admin.Controller.processDate(Controller.java:264)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> .... ....
> Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near
> "$2"
> at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:347)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.execPreparedStatement(JdbcControlImpl.java:290)
> at
> org.apache.beehive.controls.system.jdbc.JdbcControlImpl.invoke(JdbcControlImpl.java:224)
> at
> eu.horizon_it.invoices.controls.InvoiceControlBean.insertIntoTestStringEscaped(InvoiceControlBean.java:353)
> ... 41 more
>
>
>