Java JDBC H2 Connection getConnection()

Here you can find the source of getConnection()

Description

get Connection

License

Open Source License

Declaration

public static Connection getConnection() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Main {
    public static Connection getConnection() {
        Connection connection = null;
        try {// www.j  ava2 s. c  o  m
            Class.forName("org.h2.Driver");
            connection = DriverManager.getConnection(
                    "jdbc:h2:D:/work/workspace/fork/gs-serving-web-content/initial/data/fdata;DATABASE_TO_UPPER=false",
                    "h2", "h2");
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return connection;
    }
}

Related

  1. createDBWithTB(String db)
  2. deleteDatabase()
  3. deleteDatabaseH2()
  4. getH2Connection(String dbname)
  5. getH2Connection(String filename)
  6. isH2DbAlreadyRunning()
  7. rollback(Savepoint sp)