Results 1 to 1 of 1
Thread: Fetching rows from DB
-
Fetching rows from DB
The code snippet below fetches all the rows that matches the criteria in where clause.
Java Code:String name = cust_name.getText(); try { Statement stmt; String sql; sql = "select custName from tCust where custName = " += "'" + name + "'"; stmt = theConn.createStatement(); ResultSet rs; rs = stmt.executeQuery(); while (rs.next()) { System.out.println(rs.getString("custName")); } rs.close(); stmt.close(); } catch (Exception e) { e.printStackTrace(); }
Similar Threads
-
Deleting All rows in the JTable
By surot in forum New To JavaReplies: 1Last Post: 04-16-2008, 10:44 AM -
fetching document content and MIME_TYPE through share-point connector API
By suresh72 in forum Advanced JavaReplies: 0Last Post: 12-19-2007, 11:47 AM -
How to read block of rows from database tables
By lmenaria in forum JDBCReplies: 1Last Post: 08-08-2007, 01:22 AM -
display rows in jtable
By osval in forum AWT / SwingReplies: 1Last Post: 08-06-2007, 08:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks