Examples of MysqlDataSource


Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

   * due to Reference containing RefAddrs with null content.
   *
   * @throws Exception if the test fails
   */
  public void testBug16791() throws Exception {
    MysqlDataSource myDs = new MysqlDataSource();
    myDs.setUrl(dbUrl);
    Reference asRef = myDs.getReference();
    System.out.println(asRef);
   
    removeFromRef(asRef, "port");
    removeFromRef(asRef, NonRegisteringDriver.USER_PROPERTY_KEY);
    removeFromRef(asRef, NonRegisteringDriver.PASSWORD_PROPERTY_KEY);
    removeFromRef(asRef, "serverName");
    removeFromRef(asRef, "databaseName");
   
    MysqlDataSource newDs = (MysqlDataSource)new MysqlDataSourceFactory().getObjectInstance(asRef, null, null, null);
  }
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

   * expect them to be.
   *
   * @throws Exception if the test fails.
   */
  public void testBug19169() throws Exception {
    MysqlDataSource toSerialize = new MysqlDataSource();
    toSerialize.setZeroDateTimeBehavior("convertToNull");
   
    boolean testBooleanFlag = !toSerialize.getAllowLoadLocalInfile();
    toSerialize.setAllowLoadLocalInfile(testBooleanFlag);
   
    int testIntFlag = toSerialize.getBlobSendChunkSize() + 1;
    toSerialize.setBlobSendChunkSize(String.valueOf(testIntFlag));
   
    ByteArrayOutputStream bOut = new ByteArrayOutputStream();
    ObjectOutputStream objOut = new ObjectOutputStream(bOut);
    objOut.writeObject(toSerialize);
    objOut.flush();
   
    ObjectInputStream objIn = new ObjectInputStream(new ByteArrayInputStream(bOut.toByteArray()));
   
    MysqlDataSource thawedDs = (MysqlDataSource)objIn.readObject();
   
    assertEquals("convertToNull", thawedDs.getZeroDateTimeBehavior());
    assertEquals(testBooleanFlag, thawedDs.getAllowLoadLocalInfile());
    assertEquals(testIntFlag, thawedDs.getBlobSendChunkSize());
  }
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

   * due to Reference containing RefAddrs with null content.
   *
   * @throws Exception if the test fails
   */
  public void testBug16791() throws Exception {
    MysqlDataSource myDs = new MysqlDataSource();
    myDs.setUrl(dbUrl);
    Reference asRef = myDs.getReference();
    System.out.println(asRef);
   
    removeFromRef(asRef, "port");
    removeFromRef(asRef, NonRegisteringDriver.USER_PROPERTY_KEY);
    removeFromRef(asRef, NonRegisteringDriver.PASSWORD_PROPERTY_KEY);
    removeFromRef(asRef, "serverName");
    removeFromRef(asRef, "databaseName");
   
    MysqlDataSource newDs = (MysqlDataSource)new MysqlDataSourceFactory().getObjectInstance(asRef, null, null, null);
  }
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

            derbyDs.setDatabaseName( "photovault" );
            derbyDs.setCreateDatabase( "create" );
            ds = derbyDs;
        } else {
       
            MysqlDataSource mysqlDs = new MysqlDataSource();
            mysqlDs.setURL( dbUrl );
            mysqlDs.setUser( user );
            mysqlDs.setPassword( passwd );
            ds = mysqlDs;
        }
       
        Platform platform = PlatformFactory.createNewPlatformInstance( ds );
       
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

    }

    @Override
    protected Connection createConnection() throws SQLException
    {
        final MysqlDataSource ds = new MysqlDataSource();
        ds.setURL(dbUrl);
        Connection results = ds.getConnection();
        results.setAutoCommit(false);
        return results;
    }
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

        if (isLocal) {
            jdbcUrl = Const.DEV_JDBC_URL;   user = Const.DEV_USER;      password = Const.DEV_PASSWORD;
        } else {
            jdbcUrl = Const.JDBC_URL;       user = Const.USER;          password = Const.PASSWORD;
        }
        MysqlDataSource ds = new MysqlDataSource();
        ds.setUrl(jdbcUrl);     ds.setUser(user);       ds.setPassword(password);
        ActiveRecordPlugin arp = new ActiveRecordPlugin(ds);
        if (isLocal) {
            arp.setShowSql(true);
        }
        arp.addMapping("module", Module.class).addMapping("topic", Topic.class).addMapping("post", Post.class);
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

   * expect them to be.
   *
   * @throws Exception if the test fails.
   */
  public void testBug19169() throws Exception {
    MysqlDataSource toSerialize = new MysqlDataSource();
    toSerialize.setZeroDateTimeBehavior("convertToNull");
   
    boolean testBooleanFlag = !toSerialize.getAllowLoadLocalInfile();
    toSerialize.setAllowLoadLocalInfile(testBooleanFlag);
   
    int testIntFlag = toSerialize.getBlobSendChunkSize() + 1;
    toSerialize.setBlobSendChunkSize(String.valueOf(testIntFlag));
   
    ByteArrayOutputStream bOut = new ByteArrayOutputStream();
    ObjectOutputStream objOut = new ObjectOutputStream(bOut);
    objOut.writeObject(toSerialize);
    objOut.flush();
   
    ObjectInputStream objIn = new ObjectInputStream(new ByteArrayInputStream(bOut.toByteArray()));
   
    MysqlDataSource thawedDs = (MysqlDataSource)objIn.readObject();
   
    assertEquals("convertToNull", thawedDs.getZeroDateTimeBehavior());
    assertEquals(testBooleanFlag, thawedDs.getAllowLoadLocalInfile());
    assertEquals(testIntFlag, thawedDs.getBlobSendChunkSize());
  }
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

   * due to Reference containing RefAddrs with null content.
   *
   * @throws Exception if the test fails
   */
  public void testBug16791() throws Exception {
    MysqlDataSource myDs = new MysqlDataSource();
    myDs.setUrl(dbUrl);
    Reference asRef = myDs.getReference();
    System.out.println(asRef);
   
    removeFromRef(asRef, "port");
    removeFromRef(asRef, NonRegisteringDriver.USER_PROPERTY_KEY);
    removeFromRef(asRef, NonRegisteringDriver.PASSWORD_PROPERTY_KEY);
    removeFromRef(asRef, "serverName");
    removeFromRef(asRef, "databaseName");
   
    MysqlDataSource newDs = (MysqlDataSource)new MysqlDataSourceFactory().getObjectInstance(asRef, null, null, null);
  }
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

    }

    @Override
    protected Connection createConnection() throws SQLException
    {
        final MysqlDataSource ds = new MysqlDataSource();
        ds.setURL(dbUrl);
        Connection results = ds.getConnection();
        results.setAutoCommit(false);
        return results;
    }
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

   * expect them to be.
   *
   * @throws Exception if the test fails.
   */
  public void testBug19169() throws Exception {
    MysqlDataSource toSerialize = new MysqlDataSource();
    toSerialize.setZeroDateTimeBehavior("convertToNull");
   
    boolean testBooleanFlag = !toSerialize.getAllowLoadLocalInfile();
    toSerialize.setAllowLoadLocalInfile(testBooleanFlag);
   
    int testIntFlag = toSerialize.getBlobSendChunkSize() + 1;
    toSerialize.setBlobSendChunkSize(String.valueOf(testIntFlag));
   
    ByteArrayOutputStream bOut = new ByteArrayOutputStream();
    ObjectOutputStream objOut = new ObjectOutputStream(bOut);
    objOut.writeObject(toSerialize);
    objOut.flush();
   
    ObjectInputStream objIn = new ObjectInputStream(new ByteArrayInputStream(bOut.toByteArray()));
   
    MysqlDataSource thawedDs = (MysqlDataSource)objIn.readObject();
   
    assertEquals("convertToNull", thawedDs.getZeroDateTimeBehavior());
    assertEquals(testBooleanFlag, thawedDs.getAllowLoadLocalInfile());
    assertEquals(testIntFlag, thawedDs.getBlobSendChunkSize());
  }
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.