Package java.sql

Examples of java.sql.Driver.connect()


        boolean expectUrlEqualsGetUrl, String url, Properties info)
    throws SQLException
    {
        Driver driver = DriverManager.getDriver(url);

        Connection conn = driver.connect(url, info);
        assertNotNull(conn);
  
        if (expectUrlEqualsGetUrl)
            assertEquals(url, conn.getMetaData().getURL());
        else
View Full Code Here


     */
    private static void shutdownDB(String url, Properties info) throws SQLException {
       
        Driver driver = DriverManager.getDriver(url);
        try {
            driver.connect(url, info);
        } catch (SQLException se) {
            assertSQLState("08006", se);
        }
    }

View Full Code Here

            if (data.password != null) {
                props.put("password", data.password);
            }
            Connection con = null;
            try {
                con = driver.connect(data.url, props);
                final DatabaseMetaData metaData = con.getMetaData();
                return metaData.getDatabaseProductName() + " " + metaData.getDatabaseProductVersion();
            } finally {
                if (con != null) {
                    try {
View Full Code Here

        Properties props = new Properties();
        final String tenantId = "00Dxx0000001234";
        props.put(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId);

        Connection connection = driver.connect(url, props);
        assertEquals(tenantId, connection.getClientInfo(PhoenixRuntime.TENANT_ID_ATTRIB));
    }
}
View Full Code Here

         SQLDriverManager sqlDrMan = _app.getSQLDriverManager();
         //Getting java.sql.Driver to run shutdown command
         Driver jdbcDr = sqlDrMan.getJDBCDriver(drId);
         //Shutdown Embedded Derby DB
         try {
            jdbcDr.connect("jdbc:derby:;shutdown=true", new Properties());
         } catch (SQLException e) {
            //it is always thrown as said in Embedded Derby API.
            //So it is not error it is info
            s_log.info(e.getMessage());
         }
View Full Code Here

    Driver d = (Driver)Class.forName(driver).newInstance();
    Properties p = new Properties( );
    p.setProperty("user", user);
    p.setProperty("password", pass);
    //Connection conn = DriverManager.getConnection(url, user, pass);   
    Connection conn = d.connect(url, p);
    query = fixQuery(query, str1, "%1");
    //query = fixQuery(query, str2, "%2");
    Statement stmt = null;
    ResultSet rs = null;
    try {
View Full Code Here

            if (data.password != null) {
                props.put("password", data.password);
            }
            Connection con = null;
            try {
                con = driver.connect(data.url, props);
                final DatabaseMetaData metaData = con.getMetaData();
                return metaData.getDatabaseProductName() + " " + metaData.getDatabaseProductVersion();
            } finally {
                if (con != null) {
                    try {
View Full Code Here

            String url = clientCreateUrls[i];
            try{
                if (url.equals(CLIENT_CREATE_URL_WITH_COLON1))
                {
                    Driver driver = DriverManager.getDriver(url);
                    assertNull(driver.connect(url,info));
                }
                else
                    assertConnect(true, url, info);
            }
            catch(SQLException se){
View Full Code Here

        boolean expectUrlEqualsGetUrl, String url, Properties info)
    throws SQLException
    {
        Driver driver = DriverManager.getDriver(url);

        Connection conn = driver.connect(url, info);
        assertNotNull(conn);
  
        if (expectUrlEqualsGetUrl)
            assertEquals(url, conn.getMetaData().getURL());
        else
View Full Code Here

     */
    private static void shutdownDB(String url, Properties info) throws SQLException {
       
        Driver driver = DriverManager.getDriver(url);
        try {
            driver.connect(url, info);
        } catch (SQLException se) {
            assertSQLState("08006", se);
        }
    }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.