JDBC NULL ポインタ エラーです。データベースにアクセスしている間。これは私が実行しているクエリです。
"INSERT INTO paritosh ( customer, contactPerson, mobileNo, phoneNo, emailId, chairman, instituteName, totalEmployees, totalFaculty, totalStudents, totalClassroom, address, state, revenue, clientRate, acceptedRate, valuePerCard, rating, finderName, finderFee, comments ) VALUES ('kinley', 'adfa' , '232131' , '2323' , '@gmail' , 'adfadf' , 'zxc' ,100,11,1000,30, 'dfdfa' , 'Delhi' , 66000,60000,60000,600, 'Hot' , 'tyu' , 8, 'dfadfadfasdf');"
アクセスでSQLクエリとしてコードを実行すると、クエリは正常に実行されます.....
助けてください
JDBC コードは次のとおりです。
String insertq="INSERT INTO paritosh ( customer, contactPerson, mobileNo, phoneNo, emailId, chairman, instituteName, totalEmployees, totalFaculty, totalStudents, totalClassroom, address, state, revenue, clientRate, acceptedRate, valuePerCard, rating, finderName, finderFee, comments )";
String query=" VALUES ('"+customer+"', '"+contact+"' , '"+mobile+"' , '"+phone+"' , '"+email+"' , '"+chairman+"' , '"+institute+"' ,"+totalEmployees+","+totalFaculty+","+totalStudents+","+classroom+", '"+address+"' , '"+state+"' , "+revenue+","+clientRate+","+accepRate+","+valPercard+", '"+Rating+"' , '"+finderName+"' , "+finderFee+", '"+comment+"');";
String build=insertq+query;
String query2="INSERT INTO paritosh ( customer, contactPerson, mobileNo, phoneNo, emailId, chairman, instituteName, totalEmployees, totalFaculty, totalStudents, totalClassroom, address, state, revenue, clientRate, acceptedRate, valuePerCard, rating, finderName, finderFee, comments ) VALUES ('virappan', 'dussal' , '4269887' , '12334567' , 'kumar@ril.com' , 'kumar' , 'RMIT' ,300,120,3000,150, 'adfad' , 'Delhi' , 400000,380000,390000,1500, 'Hot' , 'vineet' , 9, 'afddf');";
try{
s.execute(build);
}
catch(SQLException se)
{
System.out.println("SQL eception");
}
catch(Exception e)
{
System.out.println(e);
System.out.println(" error after running the query");
}