pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: GyLes <gihemail-postgresql@yahoo.fr>
To: pgsql-jdbc@postgresql.org
Subject: JDBC 3 version 8.0 Error from cast conversion
Date: Tue, 27 Sep 2005 10:19:47 +0200 (CEST)
Message-ID: <20050927081948.63579.qmail@web25804.mail.ukl.yahoo.com> (raw)

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



Message-ID: <20050927081948.63579.qmail@web25804.mail.ukl.yahoo.com>
Permalink:  ../20050927081948.63579.qmail@web25804.mail.ukl.yahoo.com/
Also on:    postgresql.org/message-id/20050927081948.63579.qmail@web25804.mail.ukl.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: gihemail-postgresql@yahoo.fr
  Subject: Re: JDBC 3 version 8.0 Error from cast conversion
  In-Reply-To: <20050927081948.63579.qmail@web25804.mail.ukl.yahoo.com>
  References: <20050927081948.63579.qmail@web25804.mail.ukl.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox