嗨,我想在 MySQL 数据库中插入值并在下面附上我的编码,但我遇到了错误。
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(DB_URL,"root","root");
System.out.println("Remote DB connection established");
PreparedStatement statement=con.prepareStatement("INSERT INTO TBL_MONTHLY_EXPENSES_DETAILS"+
(AVG_COST, RWDS_INCENT,OTH_EXPENSES,TRAVELLING_EXPENSES,CLIENT_VISITS,REV_RECD)VALUES
(AVG_COST, RWDS_INCENT,OTH_EXPENSES,TRAVELLING_EXPENSES,CLIENT_VISITS,REV_RECD);
}catch(Exception e){
System.out.println("Remote DataBase connection establishment error.");
e.printStackTrace();
pn.setProjectName("Failed");
System.out.println(e.getMessage().toString());
}