0
  @Override
public void start(Stage primaryStage) throws Exception{

   try{
       String fxmlName;
       Connection con = DriverManager.getConnection("url","root","password");
       Statement st = con.createStatement();
       String qry = "select UpdateT from schema.update";
       ResultSet rs = st.executeQuery(qry);


        fxmlName = rs.getString("UpdateT");
      // System.out.println(fxmlName);
       st.close();
       Parent root = FXMLLoader.load(getClass().getResource(fxmlName));

       primaryStage.setScene(new Scene(root));
       primaryStage.initStyle(StageStyle.UNDECORATED);

       primaryStage.show();

   }
   catch (Exception e){
       System.out.println(e);
   }
}

Hey guys this is my code and its my first time on stack overflow and why I am getting this exception?

java.sql.SQLException: Before start of result set

Trevor
  • 7,777
  • 6
  • 31
  • 50
Talha
  • 3
  • 2

1 Answers1

2

UPDATE is a reserved word, so your DB objects should not use it. You can:

  • change the table name (i 'd prefer this)
  • use quotes every time to refer to that table
Alfabravo
  • 7,493
  • 6
  • 46
  • 82