NullPointerException error...

From: Frances Del Rio (fdr58_at_yahoo.com)
Date: 02/20/05


Date: Sun, 20 Feb 2005 11:16:33 -0500


   try {
String url = <url>;
      Statement stmt; // no problem here...

     ResultSet rs; // get error says this var should be initialized..
// if I do
   ResultSet rs = null; // get java.lang.NullPointerException error..

    Class.forName("com.mysql.jdbc.Driver").newInstance();
                
    con = DriverManager.getConnection(url);

       stmt = con.createStatement();
             while (rs.next()) {
         String themovies = rs.getString("title");
// out.print(themovies);
}

thank you..

Frances