Package java.sql

Examples of java.sql.Driver.connect()


        assertEquals(dr.getMajorVersion(), meta.getDriverMajorVersion());
        assertEquals(dr.getMinorVersion(), meta.getDriverMinorVersion());
        assertTrue(dr.jdbcCompliant());

        assertEquals(0, dr.getPropertyInfo(null, null).length);
        assertTrue(dr.connect("jdbc:test:false", null) == null);

        assertTrue(meta.getNumericFunctions().length() > 0);
        assertTrue(meta.getStringFunctions().length() > 0);
        assertTrue(meta.getSystemFunctions().length() > 0);
        assertTrue(meta.getTimeDateFunctions().length() > 0);
View Full Code Here


        props.put("user", user);
        props.put("password", pw);

        Driver driverInst = (Driver) Class.forName(driver).newInstance();

        Connection jdbcConn = driverInst.connect(url, props);
        if (jdbcConn == null) {
            throw new RuntimeException("Connect failed");
        }

        return jdbcConn;
View Full Code Here

        props.put("user", user);
        props.put("password", pw);

        Driver driverInst = (Driver) Class.forName(driver).newInstance();

        Connection jdbcConn = driverInst.connect(url, props);
        if (jdbcConn == null) {
            throw new RuntimeException("Connect failed");
        }

        return jdbcConn;
View Full Code Here

            driver = (Driver)(Class.forName(sqlDriver.getDriverClassName(),
                                            false,
                                            loader).newInstance());

    }
    Connection jdbcConn = driver.connect(alias.getUrl(), myProps);
    if (jdbcConn == null)
    {
      throw new SQLException(s_stringMgr.getString("SQLDriverManager.error.noconnection"));
    }
    return new SQLConnection(jdbcConn, props, sqlDriver);
View Full Code Here

      if (jdbcURL != null)
      {
         Driver driver = org.hsqldb.jdbcDriver.class.newInstance();
         Properties props = new Properties();
         props.put("user", "sa");
         conn = driver.connect(jdbcURL, props);
      }
      else
      {
         DataSource datasource = (DataSource) new InitialContext().lookup(getDataSourceJndiName());
         conn = datasource.getConnection();
View Full Code Here

     {
       if(!useDataSource)
       {
         String url = getConnectionURL();
         Driver d = getDriver(url);
         con = d.connect(url, copy);
         if (con == null)
           throw new JBossResourceException("Wrong driver class for this connection URL");        
       }
       else
       {
View Full Code Here

        }
       Connection con = null;
         try
         {
           Driver d = getDriver(url);
           con = d.connect(url, copy);
           if(con == null)
           {
             log.warn("Wrong driver class for this connection URL: " + url);
         urlSelector.failedUrlObject(url);
           }
View Full Code Here

        try {
            logger.debug9("calling " + SOSClassUtil.getMethodName());
            Driver driver = (Driver) Class.forName(this.driver).newInstance();

            connection = driver.connect(url, properties);

            if (connection == null)
                    throw new Exception("can't connect to database");
            versionLimiter.check(this, logger);
            logger.debug6(".. successfully connected to " + url);
View Full Code Here

    try {
      logger.debug9("calling " + SOSClassUtil.getMethodName());
      Driver driver = (Driver) Class.forName(this.driver).newInstance();

      connection = driver.connect(url, properties);

      if (connection == null)
        throw new Exception("can't connect to database");

      logger.debug6(".. successfully connected to " + url);
View Full Code Here

        try {
            logger.debug9("calling " + SOSClassUtil.getMethodName());
            Driver driver = (Driver) Class.forName(this.driver).newInstance();

            connection = driver.connect(url, properties);

            if (connection == null)
                    throw new Exception("can't connect to database");
            versionLimiter.check(this, logger);
            logger.debug6(".. successfully connected to " + url);
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.