Hi Chris,

See the code how load BLOB into a MySQl

String saveSql = "INSERT INTO Table (DataCol) VALUES (?)"


 try {
            bos = new ByteArrayOutputStream();
            oos = new ObjectOutputStream(new BufferedOutputStream(bos));

            fileObj.writeObjectData(oos);
            oos.close();

            byte[] obs = bos.toByteArray();
            int size = obs.length;
            bis = new ByteArrayInputStream(obs, 0, size);
            in = new BufferedInputStream(bis, size);

            if(preparedSaveSql == null)
                preparedSaveSql = _conn.prepareStatement(saveSql);

            preparedSaveSql.setBinaryStream(1, in, size);
            preparedSaveSql.execute();
        } catch(SQLException e) {
            }

Regards
Daya Krishan Dubey
Core Solucomm Ltd
423 B, Hamilton court,
DLF phase IV
Gurgaon, India
Ph No :- 6392896/7 (O)



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to