11行目: | 11行目: | ||
static final String PASSWD = "hoge"; | static final String PASSWD = "hoge"; | ||
public static ArrayList<Item> | public static ArrayList<Item> getRow() { | ||
try (Connection | try (Connection c = DriverManager.getConnection(URL, USER, PASSWD);) { | ||
Statement | Statement s = c.createStatement(); | ||
... | |||
2019年6月28日 (金) 00:32時点における版
私は一連のJDBC(Java DataBase Connectivity)ドライバを管理します。
メソッド
- getConnection - 指定データベースURLへの接続を試みる
例
static final String URL = "jdbc:mysql://localhost:3306/day_results"; static final String USER = "yoosuke"; static final String PASSWD = "hoge"; public static ArrayList<Item> getRow() { try (Connection c = DriverManager.getConnection(URL, USER, PASSWD);) { Statement s = c.createStatement(); ...