数据库更新出问题(上火啊)
代码如下,CON是数据库连接驱动类
public class testmain {
private static String user_id= "cc ";
private static String password= "ccc ";
private static String company_id= "asdfsa ";
private static String role_id= "sadfsdf ";
private static String car_no= "asdfasdf ";
private static String vehicle_team= "asdfasd ";
private static String user_name= "asdf ";
private static String certificate= "asdfsdf ";
private static String address= "asdfsdf ";
private static String addressnumber= "asdfafd ";
private static String call= "adsfsad ";
private static String email= "adfasfd ";
/** Creates a new instance of testmain */
public testmain() {
}
public static void main(String args[])
{
sql_con con=new sql_con();
int result=0;
try{
//下面这个更新执行错误~~~
String hello= "insert into gps_user values( ' "+
user_id+ " ', ' "+password+ " ', ' "+role_id+ " ' , ' "+company_id+ " ', "+car_no+ " ', ' "+vehicle_team+ " ', ' "+user_name+ " ', ' "+certificate+ " ', "+address+ " ', ' "+addressnumber+ " ', ' "+call+ " ', ' "+email+ " ') ";
result=con.sm.executeUpdate(hello);
//而下面这个更新执行却是正确的