Examples of Driver


Examples of java.sql.Driver

        }

        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

Examples of java.sql.Driver

        }

        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

Examples of java.sql.Driver

  /**
   * @param args
   */
  public static void main(String[] args) throws Exception
  {
    Driver driver = (Driver) (Class.forName("oracle.jdbc.driver.OracleDriver").newInstance());
   
    String nullUrl = null;
    String emptyUrl = "";
    String oracleUrl = "jdbc:oracle:thin:@localhost:1521:orcl";
   
View Full Code Here

Examples of java.sql.Driver

      System.err.println("usage: java -cp DriverInspector.jar:vendordriver.jar <driver classname>");
      System.exit(1);
    }
   
    Class<?> driverClass = Class.forName(args[0]);
    Driver d = (Driver)driverClass.newInstance();
   
    System.out.println("Driver class: "+d.getClass().getName());
    System.out.println("Driver Major Version: "+d.getMajorVersion());
    System.out.println("Driver Minor Version: "+d.getMinorVersion());   
  }
View Full Code Here

Examples of java.sql.Driver

          ClassNotFoundException, MalformedURLException
  {
    unregisterSQLDriver(sqlDriver);
    sqlDriver.addPropertyChangeListener(_myDriverListener);
        SQLDriverClassLoader loader = new SQLDriverClassLoader(sqlDriver);
    Driver driver =
            (Driver)(Class.forName(sqlDriver.getDriverClassName(),
                                   false,
                                   loader).newInstance());
    _driverInfo.put(sqlDriver.getIdentifier(), driver);
    _classLoaders.put(sqlDriver.getIdentifier(), loader);
View Full Code Here

Examples of java.sql.Driver

    if (pw != null)
    {
      myProps.put("password", pw);
    }

    Driver driver = _driverInfo.get(sqlDriver.getIdentifier());
    if (driver == null)
    {
            // TODO: Why shouldn't we call registerSQLDriver here? RMM 20070401
      s_log.debug("Loading driver that wasn't registered: " +
              sqlDriver.getDriverClassName());
      ClassLoader loader = new SQLDriverClassLoader(sqlDriver);
            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

Examples of java.sql.Driver

      return getEasyMockSQLMetaData(dbName, dbURL, nice, true);
   }

   public static SQLDriverManager getEasyMockSQLDriverManager() {
      SQLDriverManager result = createMock(SQLDriverManager.class);
      Driver mockDriver = createMock(Driver.class);
      replay(mockDriver);
      expect(result.getJDBCDriver(isA(IIdentifier.class))).andReturn(mockDriver)
                                                          .anyTimes();
      replay(result);
      return result;
View Full Code Here

Examples of java.sql.Driver

   private Connection getConnection() throws Exception
   {
      Connection conn = null;
      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

Examples of java.sql.Driver

   {
      if (datasource == null)
      {
         try
         {
            Driver driver = org.hsqldb.jdbcDriver.class.newInstance();
            String host = System.getProperty(DBSetupDelegate.DBADDRESS_PROPERTY, DBSetupDelegate.DEFAULT_ADDRESS);
            // JBAS-8540
            String jdbcURL = "jdbc:hsqldb:hsql://" + JBossTestUtil.fixHostnameForURL(host) + ":" + DBSetupDelegate.DEFAULT_PORT;
            datasource = new MockDataSource(driver, jdbcURL, "sa", null);
         }
View Full Code Here

Examples of java.sql.Driver

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