清單 4. 一個(gè)讀取數(shù)據(jù)的完整示例 // First, get all rows meeting the criterion RowSet rs = table.getRows( "id<103" ); // Iterate through the set for (int i=0; i<rs.length(); ++i) { // Grab each row in turn Row row = rs.get( i ); // Get and PRint the value of the "name" field String name = row.get( "name" ); System.out.println( "Name: "+name ); }
清單 5. 重新創(chuàng)建一個(gè) Row // Create an empty row object Row row = new Row(); // Fill it up with data row.put( "id", "200" ); row.put( "name", "Joey Capellino" );
清單 6. 修改現(xiàn)有的 Row // Grab a row from the database Row row = table.getRow( someConditions ); // Change some or all of the fields row.put( "name", "Joey Capellino" );