J
joealey2003
Hi all...
So, the whole thing i need to do is save an URL on mysql a binary
mysql 4.1 column.
Here goes the non working code...
---------------------------//
URL actual_get = new URL("http://www.myurl.com/");
InputStream Content = (InputStream)actual_get.getContent();
PreparedStatement ps = null;
ps = con.prepareStatement("insert into blobtable values (?)");
ERROR--> ps.setBinaryStream(1,Content,Content.available()); <----ERROR
ps.executeUpdate();
ps.close();
---------------------------//
This code returns many erros like "null pointer exception" or
"Premature EOF"
I am guessing the content.availabe() does not return the value it
should.
How can i write a function InpuStreamToByte(InputStream)?
Using a byte i will have the exactly length and i am guessing i would
avoid these erros.
Thanks.
So, the whole thing i need to do is save an URL on mysql a binary
mysql 4.1 column.
Here goes the non working code...
---------------------------//
URL actual_get = new URL("http://www.myurl.com/");
InputStream Content = (InputStream)actual_get.getContent();
PreparedStatement ps = null;
ps = con.prepareStatement("insert into blobtable values (?)");
ERROR--> ps.setBinaryStream(1,Content,Content.available()); <----ERROR
ps.executeUpdate();
ps.close();
---------------------------//
This code returns many erros like "null pointer exception" or
"Premature EOF"
I am guessing the content.availabe() does not return the value it
should.
How can i write a function InpuStreamToByte(InputStream)?
Using a byte i will have the exactly length and i am guessing i would
avoid these erros.
Thanks.