Java examples for JDBC:Connection
create Connection for derby
//package com.java2s; import java.sql.Connection; import java.sql.DriverManager; public class Main { public static Connection createConnection() { Connection conn;//from w ww.ja va2 s.c o m try { String url = "jdbc:derby://localhost/db;create=true"; conn = DriverManager.getConnection(url, "app", "123"); } catch (Exception e) { throw new RuntimeException(e); } return conn; } }