Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class JDBC_Experiment {
- // JDBC Driver name and DB URL
- static String Driver = "Placeholdervalue"; // this will be updated once the server connection name is figured out
- static String URL = "Placeholdervalue"; // this will be updated once the server connection name is figured out
- static final String JDBC_DRIVER = Driver;
- static final String DB_URL = URL;
- // creadentials
- static final String USER = "username";
- static final String PASS = "password";
- public static void main(String[] args) {
- Connection conn = null;
- Statement stmt = null;
- // try and catch statement
- try {
- Class.forName("Placeholdervalue"); // this will be updated once the connection is sorted
- System.out.println("Connecting to database...");
- }catch(SQLException se) {
- se.printStackTrace();
- } catch(Exception e) {
- e.printStackTrace();
- } finally {
- try {
- if(stmt !=null)
- stmt.close();
- }catch(SQLException se2) {
- } //
- }
- } // end main
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement