I have a table table1
in my database. This table have a column column1
set to varchar(20)
I have all my data in ArrayList<LatLng> list1
Now i trying to insert my list1
to column1
but my idea didn't work:
try
{
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection(url1, user1, pass1);
stmt = conn.createStatement();
String sql = "INSERT INTO table1 VALUES(list1)";
stmt.executeUpdate(sql);
}catch(SQLException se){
se.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}finally{
try{
if(stmt!=null)
conn.close();
}catch(SQLException se){
}
try{
if(conn!=null)
conn.close();
}catch(SQLException se){
se.printStackTrace();
}
}
What is wrong here?