Last active
November 11, 2016 17:32
-
-
Save zaleslaw/216b7f2317a0f3a49aed3cf5b5ca0a87 to your computer and use it in GitHub Desktop.
JDBC intro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws SQLException { | |
Connection connection = getConnection(DB_NAME); | |
System.out.println(connection.getCatalog()); | |
} | |
private static Connection getConnection(String databaseName) throws SQLException { | |
return DriverManager.getConnection(URL + databaseName, USER_NAME, PASSWORD); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment