Package java.sql

Examples of java.sql.Driver.connect()


            String conStr = "jdbc:derby:"+dbname+";"+
                Attribute.REPLICATION_INTERNAL_SHUTDOWN_SLAVE+
                "=true";

            embedDriver.connect(conStr, (Properties) null);
        } catch (Exception e) {
            // Todo: report error to derby.log if exception is not
            // SQLState.SHUTDOWN_DATABASE
        }
    }
View Full Code Here


        {
            log("connecting to " + url, Project.MSG_VERBOSE);
            Properties info = new Properties();
            info.put("user", userId);
            info.put("password", password);
            conn = driverInstance.connect(url, info);

            if (conn == null)
            {
                // Driver doesn't understand the URL
                throw new SQLException("No suitable Driver for " + url);
View Full Code Here

    // find the real driver for the URL
    Driver passThru = findPassthru(url);

    P6LogQuery.debug("this is " + this + " and passthru is " + passThru);

    Connection conn = passThru.connect(extractRealUrl(url), properties);

    if (conn != null) {
      conn = P6Core.wrapConnection(conn);
    }
    return conn;
View Full Code Here

            return DriverManager.getConnection(url, properties);
        } catch (Exception e) {
            // if the current class loader can not access the driver class, create driver class directly
            try {
                Driver driverObject = driverClass.getConstructor().newInstance();
                Connection connection = driverObject.connect(url, properties);
                if (connection == null) {
                    throw new IllegalStateException(MessageFormat.format(
                            "Driver class {0} may not support {1}",
                            driverClass.getName(),
                            url));
View Full Code Here

            }
            if (connectionProperties != null) {
                properties.putAll(connectionProperties);
            }

            Connection connection = driver.connect(databaseSettings.getDatabaseUrl(), properties);
            if (connection == null) {
                throw new SQLException("Driver refused to create connection for this configuration. No failure information provided.");
            }
            connection.setAutoCommit(autoCommit);
            if (connectionStatus != null) {
View Full Code Here

        {
            log("connecting to " + url, Project.MSG_VERBOSE);
            Properties info = new Properties();
            info.put("user", userId);
            info.put("password", password);
            conn = driverInstance.connect(url, info);

            if (conn == null)
            {
                // Driver doesn't understand the URL
                throw new SQLException("No suitable Driver for " + url);
View Full Code Here

                Driver driver = (Driver)dc.newInstance();               
                Properties info = new Properties();
                info.put( "user", user );
                info.put( "password", password );
               
                driver.connect(shutDownURI, info);
            }

        }
     catch (SQLException e)  {
        if ( driverName.equals("org.apache.derby.jdbc.EmbeddedDriver") && (e.getSQLState().equals("XJ015") ||  e.getSQLState().equals("08006"))) {
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{con.close();}catch(SQLException e) {}
            }
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

            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{con.close();}catch(SQLException e) {}
            }
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.