mysql - Return list of query in Java 1 dimensional e.g., 1 row is returned -
I have a lot of trouble through all of my records, perhaps someone reading my code can help.
Private string saving data (handle handle, string username, string name, string professor, string table) {String sqlCommand; Maps & lt; String, Object & gt; UserResults; For (integer table name = 1; table name <5; table new ++) {/ query all tables sqlCommand = String.format ("select varname fROM" + tableNum.toString ()); UserResults = handle.createQuery (sqlCommand) .bind ("user name", user name) .first (); // (map entry & lt; string, object & gt; entry: userResults.entrySet ()) {object obj = entry.getValue (); Attempting to reset all records. // is not. As the bottom (string)}} Get the desired region logger. Debug ("Result:" + userResults.toString ()); String Varnam = (string) userResults.get ("Varname"); If ((varname.toLowerCase ()). Matches (name.toLowerCase ())) "" return; } // Save data return name; }
How do I repeat through each record in the table?
You say that it works for row 1 On .first ();
and you have not tried to bring the next record. Modify your query - The documentation says that you can use .list (maxRows);
Comments
Post a Comment