Java JDBC Derby Connection getDerbyUnitConnection()

Here you can find the source of getDerbyUnitConnection()

Description

get Derby Unit Connection

License

Apache License

Declaration

public static Connection getDerbyUnitConnection() throws SQLException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static Connection getDerbyUnitConnection() throws SQLException {
        String url = "jdbc:derby:memory:flexims;create=true";
        Properties props = new Properties();
        props.setProperty("user", "flexims");
        props.setProperty("password", "123456");
        return DriverManager.getConnection(url, props);

    }//from  w w  w .ja  v  a  2 s.  c om

    public static Connection getConnection() throws SQLException {
        return getDerbyUnitConnection();
    }
}

Related

  1. getConnection()
  2. getDatabaseConnection()
  3. getDefaultDerbyConnection()
  4. getDerbyConnection(String filename)
  5. getDerbyDatabaseProperty(Statement derbyStatementForQuerying, String propertyKey)
  6. getDriver(String className)
  7. getLocalConnection()
  8. getRowsFromDatabase(Connection con, int numberOfRows, boolean reuseConnection, String driver, String dsn, String user, String password, String tableName, String whereString, String orderByString, String groupByString)
  9. getSessionIds()