I have done tests that show it is being successfully created and sent to the server.
I have narrowed it down to the UPDATE statement of the SQL. It seems that when it is actually saved to the database using UPDATE, it changes somehow.
The database table is set up to receive a BLOB type.
Any thoughts on what's going wrong??
Here is a snippet of code:
Code: Select all
int pid = tileData.getInt("pid");
int sectX = tileData.getInt("sectX");
int sectY = tileData.getInt("sectY");
byte[] byteArray = tileData.getByteArray("tileData");
getExtension().trace(byteArray[0]); // traces the correct first value in the byteArray
if(user.getVariable("admin").getBoolValue()){
getExtension().trace("updating tile data: " + byteArray.length); // traces the correct size.
String updateSQL = "UPDATE tile_data " +
"SET tileData = '" + byteArray + "' " +
"WHERE planetID = '" + pid + "' " +
"AND sectX = '" + sectX + "' " +
"AND sectY = '" + sectY + "'";
try {
_dbManager.executeUpdate(updateSQL);
...
...
...
It's also worth mentioning that SOMETHING is being written to the database because the BLOB field's size changes. However the size does not reflect that of the binary data, and when reading the stored binary data the data seems to have changed.