Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java.sql.SQLException: The column position '0' is out of range. The number of columns for this ResultSet is '1'. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) at
java.sql.SQLException: The column position '0' is out of range. The number of columns for this ResultSet is '1'. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) at org.apache.derby.client.am.ResultSet.getInt(Unknown Source) at flightschedulersfs5208.Flight.getnumSeats(Flight.java:98) at flightschedulersfs5208.Booking.addBooking(Booking.java:168)
Start Page FightSchedulers fs5208 java Files Projects Servi... Databases Source History Java DB 82 Drivers public int getnumseats (String name 83 jdbc: derby://localhost: 1527/Flight System. out println hi JAVA System. out printin (name 85 Tables int result 0; BOOKINGS ResultSet resultSet null DAYS try{ 88 FLIGHTS PreparedStatement s connection preparestatement 89 NAME SELECT numseats FROM Flights where name 90 NUM SEATS s. setString (1, name); 91 Indexes resultSet s.executeQuery 92 Foreign Keys resultSet .next 93 Views 94 Procedures System.out println ("h"); 95 Other schemas 96 jdbc:derby://local host 15 27/samp num Seats) result resultSet.getint 97 98 Servers 99 System out printin result Maven Repositories 100 Cloud 101 Hudson Builders 102 Docke Task Repositories output Selenium Serve Java DB Database Process Flight Schedulersfs5208 (run SQL 1 execution run alliswell 2017-05-0 S333 hello there java. sgl.SQLException: he column position '0' is out of range The number of columns for this ResultSet is at org.apache.derby.client.am.SQLException Factory40.getSQLException (Unknown Source) at org.apache.derby.client.am. SquException.getSOLException (Unknown Source) at org.apache. derby.client.am.ResultSet.getInt(Unknown Source) at flightschedulers fs5208. Flight.getnumseats (Flight ava: 98 at flightschedulersfs5208.Booking.addBooking ava: 168 Book in at flightschedulersfs5208.FlightSchedulers fs5208.insert ButtonActionPerformed (FlightSchedulersfs5208 at flightschedulersfs5 FlightSchedulers 8. access$500 FlightSche java: 48 at flight schedulers fis5208. FlightSched .action Performed (FlightSchedulersfs5208.java:290 at javax.swing AbstractButton. fireActionPerformed ava: 2022 98:6 NSStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started