Assuming there is a table called employee with a column named EMPNAME in the database. This is the code snippet that could achieve the objective.
Class.forName("org.hsqldb.jdbcDriver");
conn = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/testdb", "SA", "");
stm = conn.createStatement();
rs = stm.executeQuery("select * from employee");
while( rs.next() ) {
System.out.println(rs.getString("EMPNAME"));
}
conn = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/testdb", "SA", "");
stm = conn.createStatement();
rs = stm.executeQuery("select * from employee");
while( rs.next() ) {
System.out.println(rs.getString("EMPNAME"));
}
No comments:
Post a Comment