I haven't been using java that long, but I'm currently in a class and we've been given this program to complete; I have been working on this for the last for 3 days now and I keep getting this error:
Selecting the correct constructor
Exception in thread "main" java.lang.NullPointerException
at SlotReservation.main(SlotReservation.java:80)
referenced code:
while(answer<1750)
{
answer++;
//Selecting a user randomly from the user table such that he is not in the parking lot and has not been used till now.
ResultSet rs1=stmt.executeQuery("SELECT MIN(car_regnum), start_time,end_time FROM fsbm_data where temp_present='0' and temp_block='0'");
if (rs1.next())
{
arrivalThreadRegnum = Integer.parseInt(rs1.getString(1).trim());
startTime = Integer.parseInt(rs1.getString(2).trim());
endTime = Integer.parseInt(rs1.getString(3).trim());
stmt.executeUpdate("UPDATE fsbm_data set temp_present=1, temp_block=1 where car_regnum="+rs1.getString(1));
//Calling thread for each new user and sending his registration number and advance reservation spot number
new FreeSpaceDetection(userPL.summaryVector,userPL.bit Map,arrivalThreadRegnum, startTime,endTime,userPL.defragList);
slotNumber++;
try
{
Thread.sleep(1000);
}
END OF MY CODE:
I typed everything as it was presented, but I can't get it to run without this error.
Any suggestions would be much appreciated...