Inserting an array of byte[ ] in a database

Hi,

In my program I have to insert a bynary data in my database. To do that, I created in the database a column, called "data", and I set the type of the column to MEDIUMBLOB. I receive the data that I have to store from a serial port, so they are stored in a byte[ ] array. How can I give that array to my database?

[329 byte] By [IronBargiaa] at [2007-11-26 22:23:20]
# 1
I'd try this: http://java.sun.com/javase/6/docs/api/java/sql/PreparedStatement.html#setBytes(int,%20byte[])Alternatively, change it to an InputStream (see ByteArrayInputStream) and set data as a stream.
quittea at 2007-7-10 11:22:37 > top of Java-index,Java Essentials,Java Programming...
# 2
How can I convert an array of byte[ ] in an inputStream?
IronBargiaa at 2007-7-10 11:22:37 > top of Java-index,Java Essentials,Java Programming...
# 3
http://java.sun.com/javase/6/docs/api/java/io/ByteArrayInputStream.html
quittea at 2007-7-10 11:22:37 > top of Java-index,Java Essentials,Java Programming...