带变量的SQL语句

1.insert

String title = " hello " ;
String username
= " Joe " ;
  DBLinkBean DBLink
= new  DBLinkBean();
  String sql
= " INSERT INTO shoppingCart VALUES(' " + username + " ',' " + title + " ') " ;
  DBLink.executeQuery(sql);

 

 

你可能感兴趣的:(sql语句)