Hi, i need help on updating data in mysql using JDBC since im using java.i want to send data from arraylist and it seems and error when i run it.below is my code for update.
private void update(ArrayList<String> list, int uid)
{
try
{
Connection con=null;
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
con= DriverManager.getConnection("jdbc:mysql://localhost/t-way","root","");
PreparedStatement ps = con.prepareStatement("UPDATE `input` SET `check`=1, `output`=? WHERE `check`=0 AND `userid`=?");
ps.setArray(1,list);
ps.setInt(2,uid);
ps.executeUpdate();
ps.close();
con.close();
}
catch (Exception e)
{
System.err.println ("Cannot connect to database server "+ e.getMessage());
}
}
Error:setArray in java.sql.preparedstatement cannot to be applied to ArrayList
in database,output variable is LongBlob.if i use setBlob also got error.
Do u have any idea?i really2 stuck here