problem on using JDBC interface - Mailing list pgsql-sql

From sam_ma@hksmartone.com
Subject problem on using JDBC interface
Date
Msg-id H000046601e471f6@MHS
Whole thread Raw
List pgsql-sql
Hi,

I have construct the java program for inserting binary data into
database but i get error message as "InputStream as parameter not
supported"

Java Program:

        String upstat = "insert into sent (Mess_size,Message,
validity_period, dnc, pid, msisdn,submission,oa) values
(?,?,?,?,?,?,0,?)";
        PreparedStatement pstmt = con.prepareStatement(upstat);
        File file = new File("sample.txt");

        FileInputStream fis = new FileInputStream(file);

        pstmt.setInt(1, message.length());
        pstmt.setBinaryStream(2, fis,(int)file.length());
        System.out.println("Update Result3 ");
        pstmt.setInt(3, validity_period);
        pstmt.setInt(4, dnc);
        pstmt.setInt(5, pid);
        pstmt.setString(6, msisdn);
        pstmt.setString(7, oa);
        pstmt.executeUpdate();
        pstmt.close();

Can someone to tell me the reason and solution for this error message?

rgds

Sam Ma
Attachment

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Counting distinct names
Next
From: "Rudolph, Michael"
Date:
Subject: Problems with joining two tables