java - Mysql Result set Error -
I am executing a block of code where I will retrieve a group of database users and some things with them need to. The very simple scenario is that although I am using (rsnext ()) , when
rsnext () reaches the tap, continue with my program code Tries, while the segment and zero exits with the exception.
Why is this happening? Is something broken in my code that I can not understand? Please note that
RS never
null initially prints all of the
rs on the console, but when it reaches to the end So this gives an empty exception.
try {string sql = "select specific userid from user information"; Stmt1 = conn.createStatement (); Try (result rs = stmt1.executeQuery (sql)) {while (rs.next ()) {string mentionsIDs = (rsgetstring ("mention")). Trim (); Try {if (! Mentionss.isEmpty ()) {System.out.println (mentionsIDs); String [] arr = mentionsIDs.split ("\\ s +"); If (numeric (ARR [0])) {System.out.println (AER [0]); Sources.add (Long.parseLong (Advent [0])); }}} Hold (Exception Pre) {Logger.getLogger (App.class.getName ()). Log (Level.SEVERE, null, ex); }} Rs.close (); } Any help is appreciated.
move string mentionsIDs = (rsgetstring ("mentions")). Trim (); then try to hold inside the block NullPointerException .
Comments
Post a Comment