![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi All, I have a byte[] array data that i want to insert/update into a table in mysql. here is the code: Connection conn = .... Statement stmt = conn.createStatement(); String sql = "UPDATE cards SET BlobField = ?"; PreparedStatement pstmt = conn.prepareStatement(sql); pstmt.setBytes(1, "hghghfhgf".getBytes()); |
|
stmt.executeUpdate(sql); I have tried to set the table field to longblob, blob, but failed with error indicating syntax error "?" Zab |
#3
| |||
| |||
|
|
DBArtisan wrote: Hi All, I have a byte[] array data that i want to insert/update into a table in mysql. here is the code: Connection conn = .... Statement stmt = conn.createStatement(); String sql = "UPDATE cards SET BlobField = ?"; PreparedStatement pstmt = conn.prepareStatement(sql); pstmt.setBytes(1, "hghghfhgf".getBytes()); Try passing a string of the form X'<hexdigits>' e.g., in your example X'686768676866686766' |
| stmt.executeUpdate(sql); I have tried to set the table field to longblob, blob, but failed with error indicating syntax error "?" Zab |
#4
| |||
| |||
|
|
here is the code: Connection conn = .... Statement stmt = conn.createStatement(); String sql = "UPDATE cards SET BlobField = ?"; PreparedStatement pstmt = conn.prepareStatement(sql); pstmt.setBytes(1, "hghghfhgf".getBytes()); stmt.executeUpdate(sql); |
![]() |
| Thread Tools | |
| Display Modes | |
| |