Guest User

Untitled

a guest
Jun 29th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import org.h2.tools.Server;
  2. ...
  3. // start the TCP Server
  4. Server server = Server.createTcpServer(args).start();
  5. ...
  6. // stop the TCP Server
  7. server.stop();
  8.  
  9. * Add h2.jar to the classpath
  10. * Use the JDBC driver class: org.h2.Driver
  11. * The database URL jdbc:h2:~/test opens the database 'test' in your user home directory
  12.  
  13. import org.h2.jdbcx.JdbcDataSource;
  14. // ...
  15. JdbcDataSource ds = new JdbcDataSource();
  16. ds.setURL("jdbc:h2:˜/test");
  17. ds.setUser("sa");
  18. ds.setPassword("sa");
  19. Connection conn = ds.getConnection();
Add Comment
Please, Sign In to add comment