JDBC 3 version 8.0 Error from cast conversion - Mailing list pgsql-jdbc

From GyLes
Subject JDBC 3 version 8.0 Error from cast conversion
Date
Msg-id 20050927081948.63579.qmail@web25804.mail.ukl.yahoo.com
Whole thread Raw
List pgsql-jdbc
Hi All,

i'm using postgresql version 8.0 and 8.1 beta1 server.
I developp a little web applicaton in JSTL 1.1, JDK
1.5, tomcat 5.5.9.

Here's the HTML form to input some data :

<!-- Fichier de saisie des paramètres-->
<%@ taglib prefix="c"
uri="http://java.sun.com/jsp/jstl/core" %>
<html>
    <head>
    <title>Simple Example</title>
    </head>
    <body>
    <%@ include file='header.jsp' %>
    <c:set var="ess" value="test"/>
    <c:out value="${ess}"/>

    <form name="test" action="record.jsp"
method="get">
        code: <input type="text" name="code"/>
        text: <input type="text" name="text"/>
        <input type="submit" name="ok"/>
    </form>
    </body>
</html>

and the jsp page to record data :
<%@ taglib prefix="c"
uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql"
uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fmt"
uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
    <head>
    <title>Simple Example</title>
    </head>
    <body>
        <fmt:parseNumber var="ncode"
value="${param.code}"/>
        <sql:setDataSource
              driver="org.postgresql.Driver"
              url="jdbc:postgresql://127.0.0.1/gihe"
              user="gihe"
              password="*******"
              var="dataSource" />
        <sql:transaction dataSource="${dataSource}">
            <sql:update>
                INSERT INTO ESS.TEST (ID,NOM) VALUES
(?,?)
                <sql:param value="${ncode*1})"/>
                <sql:param value="${param.text}"/>
            </sql:update>
        </sql:transaction>
    </body>
</html>

With JDBC 3 driver version 8.0 or 8.1, i obtain an
error message from Tomcat :

javax.servlet.ServletException:
javax.servlet.jsp.JspException:
                INSERT INTO ESS.TEST (ID,NOM) VALUES
(?,?)


            : ERROR: column "id" is of type bigint but
expression is of type character varying


==> If i use JDBC 3 driver version 7.3, no problem
with postgresql version 8.0 or 8.1 beta 1 !

Any help will be welcome.

Thanks in advance.

GyLes








___________________________________________________________________________
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com

pgsql-jdbc by date:

Previous
From: Joost Kraaijeveld
Date:
Subject: Exception storing ipaddress with JBoss after upgrade to 8.0-312.jdbc3
Next
From: Dave Cramer
Date:
Subject: Re: Exception storing ipaddress with JBoss after upgrade to 8.0-312.jdbc3