M
Moerderin
i've been doing ton's of reading these past couple of days about how
to create a blob and this is about as far as i was able to get. (the
code still doesn't work) I was wondering if any computer experts out
there could help me figure out what my code is lacking or what kind
of revisions it might need, thank you
public static void main(String [] args) {
int id = 1;
byte [] data = new byte[255];
int i = 0;
Access test = new Access();
for (i=0;i<255;i++)
data = 'x';
try {
Blob blob = null;
test.connect("com.mysql.jdbc.Driver","jdbc:mysql://localhost/mdars","bfaul","123");
ResultSet rs = test.query("Select * from FrameData where
ID="+id);
rs.next();
blob = rs.getBlob("RawData");
PreparedStatement pstmt = test.dbConn.prepareStatement(
"UPDATE FrameData SET RawData = ? WHERE ID = "+id);
blob.setBytes(0,data);
pstmt.setBlob(1, blob);
pstmt.executeUpdate();
} catch (Exception error) {
error.printStackTrace();
}
}
to create a blob and this is about as far as i was able to get. (the
code still doesn't work) I was wondering if any computer experts out
there could help me figure out what my code is lacking or what kind
of revisions it might need, thank you
public static void main(String [] args) {
int id = 1;
byte [] data = new byte[255];
int i = 0;
Access test = new Access();
for (i=0;i<255;i++)
data = 'x';
try {
Blob blob = null;
test.connect("com.mysql.jdbc.Driver","jdbc:mysql://localhost/mdars","bfaul","123");
ResultSet rs = test.query("Select * from FrameData where
ID="+id);
rs.next();
blob = rs.getBlob("RawData");
PreparedStatement pstmt = test.dbConn.prepareStatement(
"UPDATE FrameData SET RawData = ? WHERE ID = "+id);
blob.setBytes(0,data);
pstmt.setBlob(1, blob);
pstmt.executeUpdate();
} catch (Exception error) {
error.printStackTrace();
}
}