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, whole thread or download thread mbox)
Lists: pgsql-sql

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

Java Program:

        String upstat = "insert into sent (Mess_size,Message, 
validity_period, dnc, pid, msisdn,submission,oa) values 
        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);

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


Sam Ma

Attachment: BDY.TXT
Description: text/plain (937 bytes)
Attachment: WINMAIL.DAT
Description: application/ms-tnef (1015 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-2017 The PostgreSQL Global Development Group