public static void main(String[] args)
{
Connection connection;
try
{
Class.forName("org.hsqldb.jdbcDriver");
connection=DriverManager.getConnection("jdbc:hsqldb:mem:demodb","sa","");
Statement st=null;
ResultSet rs=null;
st=connection.createStatement();
String sql1="create table cuser(username varchar(10))";
String sql2="insert into cuser(username) values('wanjun')";
String sql3="select * from cuser";
st.executeUpdate(sql1);
st.executeUpdate(sql2);
rs=st.executeQuery(sql3);
while(rs.next())
{
System.out.println(rs.getString(1));
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
Hsqldb In Memory
最新推荐文章于 2021-02-01 04:45:30 发布