Skip site navigation (1) Skip section navigation (2)

problem on using JDBC interface

From: sam_ma(at)hksmartone(dot)com
To: pgsql-sql(at)postgresql(dot)org
Subject: problem on using JDBC interface
Date: 2000-04-19 07:37:43
Message-ID: H000046601e471f6@MHS (view raw or flat)
Thread:
Lists: 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: WINMAIL.DAT
Description: application/ms-tnef (1015 bytes)
Attachment: BDY.TXT
Description: text/plain (937 bytes)

pgsql-sql by date

Next:From: Manuel LemosDate: 2000-04-19 07:47:06
Subject: Re: Connecting website with SQL-database.....
Previous:From: Tom LaneDate: 2000-04-19 05:05:19
Subject: Re: Counting distinct names

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group