Help storing jpeg files

Поиск
Список
Период
Сортировка
От Srikanth Rao
Тема Help storing jpeg files
Дата
Msg-id 20010202164119.7205.qmail@web6302.mail.yahoo.com
обсуждение исходный текст
Список pgsql-jdbc
My table looks like this:
          Table "office"
  Attribute   |  Type  | Modifier
--------------+--------+----------
 officeid     | bigint | not null
 fees         | oid    |
 map          | oid    |
Index: office_key

My code looks like this:

    if (map != null && fees != null) {

        File mapFile = new File("../webapps/cca/"+map);
        FileInputStream mapFis = new
FileInputStream(mapFile);
        File feesFile = new File("../webapps/cca/"+fees);
        FileInputStream feesFis = new
FileInputStream(feesFile);

        update_sql = "UPDATE Office SET \n " +
        "map = ? , \n" +
        "fees = ? \n" +
        "WHERE officeId = " + officeId + "\n";
        System.out.println(update_sql);

        PreparedStatement ps =
theConnection_.prepareStatement(update_sql);

ps.setBinaryStream(1,mapFis,(int)mapFile.length());

ps.setBinaryStream(2,feesFis,(int)feesFile.length());
        ps.executeUpdate();
        ps.close();
        feesFis.close();
        mapFis.close();
    }



My Exception that I get looks like this:

InputStream as parameter not supported
        at java.lang.Throwable.fillInStackTrace(Native
Method)
        at
java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at
java.sql.SQLException.<init>(SQLException.java:98)
        at
org.postgresql.util.PSQLException.<init>(PSQLException.java:22)
        at
org.postgresql.jdbc2.PreparedStatement.setBinaryStream(PreparedStatement.java:417)
        at CCA_Model.Office.commit(Office.java:571)
....
....


I followed what was given in the PG-SQL docs.

TIA
Sri

__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: v j
Дата:
Сообщение: Re: [INTERFACES] JDBC APPLET Problem
Следующее
От: Peter T Mount
Дата:
Сообщение: RE: [GENERAL] GIS-type databases using PostgreSQL