Subject | Re: JDBC PreparedStatement setting CHAR[4] field error / bug? |
---|---|
Author | schroed1974 |
Post date | 2003-04-17T15:01:10Z |
Hello,
I had the same problem:
try changing all CHAR fields to VARCHAR ones or download the latest
CVS version of the driver, it should work.
Best regards,
Angelo Mariano
--- In Firebird-Java@yahoogroups.com, B Reardon <vetteboybri@y...>
wrote:
ion(FBConnection.java:1008)
date(FBPreparedStatement.java:143)
ice(ContextManager.java:806)
nHandler.processConnection(Ajp12ConnectionHandler.java:166)
olTcpEndpoint.java:416)
run(ThreadPool.java:501)
mit(FBManagedConnectionFactory.java:684)
mmit(FBManagedConnection.java:410)
mit(FBLocalTransaction.java:156)
ion(FBConnection.java:1004)
date(FBPreparedStatement.java:143)
ice(ContextManager.java:806)
nHandler.processConnection(Ajp12ConnectionHandler.java:166)
olTcpEndpoint.java:416)
run(ThreadPool.java:501)
I had the same problem:
try changing all CHAR fields to VARCHAR ones or download the latest
CVS version of the driver, it should work.
Best regards,
Angelo Mariano
--- In Firebird-Java@yahoogroups.com, B Reardon <vetteboybri@y...>
wrote:
> Hello,org.firebirdsql.jdbc.FBConnection.checkEndTransact
>
> I have determined my problem using the Firebird JDBC
> driver is related to doing an INSERT into a table with
> a column of type CHAR[4].
>
> The same exact Java code I am testing works fine on
> Linux, Windows and Sun using the MSSQL and Oracle JDBC
> drivers.
>
> I am trying to populate a CHAR[4] field in a table.
>
> I have an int, fieldval, set to 1
> I have a String, sqlval, set to TEST
> I have a PreparedStatement, ps, set to ps =
> connection.prepareStatement("insert into o_brian
> (name) values (?)");
>
> I tried:
>
> ps.setString(fieldval, sqlval);
>
> which works on all other platforms, but fails on
> Firebird, so I tried:
>
> ps.setObject(fieldval, sqlval,
> java.sql.Types.CHAR);
>
> but it also fails.
>
> Here's an error dump:
>
> org.firebirdsql.jdbc.FBSQLException: GDS Exception.
> Error reading data from the connection.
>
> - Details -
>
> SQL State: null
> Message: GDS Exception. Error reading data from the
> connection.
> Vendor code: 335544726
>
> - Stack Trace -
>
> org.firebirdsql.jdbc.FBSQLException: GDS Exception.
> Error reading data from the connection.
> at
>
ion(FBConnection.java:1008)
> atorg.firebirdsql.jdbc.FBPreparedStatement.executeUp
>
date(FBPreparedStatement.java:143)
> atServletWrapper.java:405)
> com.optix.websysadm.SQLInterface.Insert(Unknown
> Source)
> at
> com.optix.websysadm.AdminServlet.doPost(Unknown
> Source)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.apache.tomcat.core.ServletWrapper.doService(
> atrvletWrapper.java:372)
> org.apache.tomcat.core.Handler.service(Handler.java:287)
> at
> org.apache.tomcat.core.ServletWrapper.service(Se
> atorg.apache.tomcat.core.ContextManager.internalServ
>
ice(ContextManager.java:806)
> atntextManager.java:752)
> org.apache.tomcat.core.ContextManager.service(Co
> atorg.apache.tomcat.service.connector.Ajp12Connectio
>
nHandler.processConnection(Ajp12ConnectionHandler.java:166)
> atorg.apache.tomcat.service.TcpWorkerThread.runIt(Po
>
olTcpEndpoint.java:416)
> atorg.apache.tomcat.util.ThreadPool$ControlRunnable.
>
run(ThreadPool.java:501)
> at java.lang.Thread.run(Thread.java:554)tion(GDS_Impl.java:544)
> at org.firebirdsql.gds.GDSException: Error reading
> data from the connection.
> at
> org.firebirdsql.jgds.GDS_Impl.isc_commit_transac
> atorg.firebirdsql.jca.FBManagedConnectionFactory.com
>
mit(FBManagedConnectionFactory.java:684)
> atorg.firebirdsql.jca.FBManagedConnection.internalCo
>
mmit(FBManagedConnection.java:410)
> atorg.firebirdsql.jca.FBLocalTransaction.internalCom
>
mit(FBLocalTransaction.java:156)
> atorg.firebirdsql.jdbc.FBConnection.checkEndTransact
>
ion(FBConnection.java:1004)
> atorg.firebirdsql.jdbc.FBPreparedStatement.executeUp
>
date(FBPreparedStatement.java:143)
> atServletWrapper.java:405)
> com.optix.websysadm.SQLInterface.Insert(Unknown
> Source)
> at
> com.optix.websysadm.AdminServlet.doPost(Unknown
> Source)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.apache.tomcat.core.ServletWrapper.doService(
> atrvletWrapper.java:372)
> org.apache.tomcat.core.Handler.service(Handler.java:287)
> at
> org.apache.tomcat.core.ServletWrapper.service(Se
> atorg.apache.tomcat.core.ContextManager.internalServ
>
ice(ContextManager.java:806)
> atntextManager.java:752)
> org.apache.tomcat.core.ContextManager.service(Co
> atorg.apache.tomcat.service.connector.Ajp12Connectio
>
nHandler.processConnection(Ajp12ConnectionHandler.java:166)
> atorg.apache.tomcat.service.TcpWorkerThread.runIt(Po
>
olTcpEndpoint.java:416)
> atorg.apache.tomcat.util.ThreadPool$ControlRunnable.
>
run(ThreadPool.java:501)
> at java.lang.Thread.run(Thread.java:554)
>
> Any suggestions would be GREATLY appreciated.
>
> Sincerely,
>
> Brian Reardon
> Senior Software Engineer
> mindwrap, Inc.
>
>
>
> __________________________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo
> http://search.yahoo.com