// Use DBUTILS1.0 version
Import java.util. *; import java.util.logging. *; import java.sql. *; import org.apache.commons.dbutils. *; import org.apache.commons.dbutils.handlers. *;
Public class testdbunits {public static void main (String [] args) throws exception {testdbunits test = new testdbunits (); for (int i = 0; i <1; i ) {test.testquery1 (); test.testquery2 () ; test.testUpdate ();}} public void testQuery1 () {try {QueryRunner qr = new QueryRunner (); ResultSetHandler rsh = new ArrayListHandler (); String strsql = "select * from test1"; ArrayList result = (ArrayList) qr .query (getConnection (), strsql, rsh; //system.out.print ("");} catch (exception ex) {ex.printstacktrace (system.out);}}} public void testquery2 () {TRY { QueryRunner qr = new QueryRunner (); ResultSetHandler rsh = new MapListHandler (); String strsql = "select * from test1"; ArrayList result = (ArrayList) qr.query (getConnection (), strsql, rsh); for (int i = 0; i