Java Android无法将数据插入Mysql数据库,但数据插入logcat

Java Android无法将数据插入Mysql数据库,但数据插入logcat,java,android,xml,json,Java,Android,Xml,Json,在代码中使用mysql语句,不要忘记关闭语句、连接实例。正确关闭它们,则只有更改才会保存在数据库中 更新: 使用以下代码使用jdbc语句将数据插入服务器数据库 try{ Connection con=DriverManager.getConnection(dburl,dbuname,dbpass); Statement stmt=con.createStatement(); stmt.executeUpdate("write insert statement here"); //clo


在代码中使用mysql语句,不要忘记关闭语句、连接实例。正确关闭它们,则只有更改才会保存在数据库中

更新:

使用以下代码使用jdbc语句将数据插入服务器数据库

try{
 Connection con=DriverManager.getConnection(dburl,dbuname,dbpass);
 Statement stmt=con.createStatement();
 stmt.executeUpdate("write insert statement here");

 //close the connection here
  con.close();
  stmt.close(); 

 }catch(Exception e){
   //write console statement here
 }

请查找上面的代码…@nagit正在显示InputEventReceiver“试图完成输入事件,但输入事件接收器已被释放”显示将此数据填充到数据库中的代码,并附上日志。02-24 10:42:52.378:W/InputEventReceiver(28247):试图完成输入事件,但输入事件接收器已被释放。02-24 10:42:52.818:W/IInputConnectionWrapper(28247):在非活动输入连接上显示状态图标02-24 10:42:52.818:W/IInputConnectionWrapper(28247):在非活动输入连接上开始批次编辑02-24 10:42:52.828:W/IInputConnectionWrapper(28247):在非活动输入连接上结束批次编辑02-24 10:42:36.878:I/LandMark(28247):ben 02-24 10:42:36.878:I/说明(28247):如何关闭连接实例我在此处未使用连接。我正在使用http post。请检查。否则,请向我发送总代码,以将数据从android发布到xampp服务器。sqlite是android的最佳数据库,请尝试sqlite。您能为我提供一个example@balayesufollow以上教程介绍了sqlite与android的连接。