Package java.sql

Examples of java.sql.Driver.connect()


            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 {
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

        {
            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

    }
   
    final Connection connection;
    if (driverImpl != null)
    {
      connection = driverImpl.connect(url, p);
    }
    else
    {
      connection = DriverManager.getConnection(url, p);
    }
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 (userPassword.hasValue())
                  properties.setProperty("password", userPassword.getValue());
               try
               {
                  Driver driver = (Driver) driverClass.getValue().newInstance();
                  try (Connection connection = driver.connect(jdbcUrl.getValue(), properties))
                  {
                     if (connection == null)
                        throw new RuntimeException("JDBC URL [" + jdbcUrl.getValue()
                                 + "] is not compatible with the selected driver [" + driverClass.getValue().getName() + "].");
View Full Code Here

                Driver instanceDriver = (Driver) classDriver.newInstance();
                /*
                 * Get Connection
                 */
                connection =
                        instanceDriver.connect(hsProperties.getPropDatabaseUrl(), propertiesUserPassword);
            } else {
                log.info("Loading Class: " + driverClass);
                /*
                 * Get Driver
                 */
 
View Full Code Here

            driver.acceptsURL( null );
            fail( "Should not have accepted a null connection url" );
        }
        catch (SQLException se) { assertSQLState( MALFORMED_URL, se ); }
        try {
            driver.connect( null, props );
            fail( "Should not have accepted a null connection url" );
        }
        catch (SQLException se) { assertSQLState( MALFORMED_URL, se ); }
       
        conn.close();
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

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.