JAVA SQL how to save the image data file

In a mobile phone picture will be saved into SQL database, how to solve, the following method suggests a strange error:

PreparedStatement statement;
try
{
//ImageFile mobile phone in the picture file, path:/mnt/sdcard/1385971283971.jpg
File file = new File(ImageFile);
FileInputStream inputStream = new FileInputStream(file);
String sql = "insert into t_s_busqm(FKeyID,FBKeyID,FPic,FDoTime,FDoUser) values(?,?,?,?,?)";
statement = conn.prepareStatement(sql);
statement.setString(1, "1");
statement.setString(2, "2");
statement.setBinaryStream(3, inputStream, (int)file.length());
statement.setString(4, "3");
statement.setString(5, "4");
statement.executeUpdate();
} catch (SQLException e1)
{
e1.printStackTrace();
}
} catch (FileNotFoundException e1)
{
e1.printStackTrace();
}


Here is how to save... Error for:

Java.sql.SQLException: first: there is a syntax error near'max'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2886)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2328)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:638)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:614)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:573)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:707)
at org.omagic.GetDataValue.SaveBmpToDB(GetDataValue.java:4881)
at org.omagic.curcustomer$7$1.refreshActivity(curcustomer.java:609)
at org.omagic.WritePadDialog$2.onClick(WritePadDialog.java:74)
at android.view.View.performClick(View.java:2485)
at android.view.View$PerformClick.run(View.java:9080)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)

Or if single hand into the FPIC field, the same can not. If not in this field, you can... For the master!!!!!!!!!!

Note: the database is SQL 2000, field type for FPic: image

Started by Beatrice at February 12, 2016 - 9:39 PM

Master ah?...

Posted by Beatrice at December 09, 2016 - 5:29 PM

How come no one to master please come out?. . . . . . .

Posted by Beatrice at December 22, 2016 - 6:24 PM

Master? Where are ah....

Posted by Beatrice at December 31, 2016 - 7:11 PM

Memory address, why the binary deposit.

Posted by Maureen at January 02, 2017 - 8:25 PM

I have to save to the server up, is not stored on the mobile phone, so be sure to save the file in the past. .

Posted by Beatrice at January 03, 2017 - 9:05 PM

Strange, this is to shut down? Or master in bed?

Posted by Beatrice at January 15, 2017 - 7:43 PM