Package com.mysql.jdbc.jdbc2.optional

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


  private final static DateFormat df = new SimpleDateFormat("yyyy-MM-dd");

   
    public static LinkedList<Long> getModules (Date i_von, Date i_bis, long i_modul_group_id)
    {
      MysqlDataSource l_ds = DBAccess.ReturnDataSource();
        Connection l_con = null;
        Statement l_stat = null;
       
      LinkedList<Long> modul_ids = new LinkedList<Long>();
      try
      {
        l_con = l_ds.getConnection();
      l_stat = l_con.createStatement()
 
       
      ResultSet s = l_stat.executeQuery("select modul_id from cvs_modul where modul_id in (select distinct(revision_modul_id)  from cvs_revision where from_unixtime(revision_date) > '" +
          df.format(i_von) + "' and from_unixtime(revision_date) < '" + df.format(i_bis) + "') and modul_group_id = " + i_modul_group_id);
View Full Code Here


    m_body = body;
  }
 
  public static LinkedList<ArtifactMessage> getArtifactMessages(long artifact_id, Date begin, Date end)
  {
    MysqlDataSource l_ds = DBAccess.ReturnDataSource();
      Connection l_con = null;
      Statement l_stat = null;
      LinkedList<ArtifactMessage> l_artifacts = new LinkedList<ArtifactMessage>();
     
      try
      {
        l_con = l_ds.getConnection();
      l_stat = l_con.createStatement()

       
      ResultSet s = l_stat.executeQuery("select id, artifact_id, submitted_by, from_unixtime(adddate) as adddate, body from artifact_message where artifact_id = " + artifact_id
          + " and from_unixtime(adddate) > '"+ df.format(begin) + "' and from_unixtime(adddate) < '" + df.format(end) + "'");
View Full Code Here

    m_submitted_by = submitted_by;
    m_adddate = adddate;
  }
  public static LinkedList<ArtifactMessage> getArtifactMessages(long artifact_id)
  {
    MysqlDataSource l_ds = DBAccess.ReturnDataSource();
      Connection l_con = null;
      Statement l_stat = null;
      LinkedList<ArtifactMessage> l_artifact_ids = new LinkedList<ArtifactMessage>();
     
      try
      {
        l_con = l_ds.getConnection();
      l_stat = l_con.createStatement()

       
      ResultSet s = l_stat.executeQuery("select id, artifact_id, submitted_by, from_unixtime(adddate) as adddate, body from artifact_message where artifact_id = " + artifact_id);
     
View Full Code Here

   * 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);
View Full Code Here

    assertEquals("Connect timeout spec'd by URL didn't take", nonDefaultConnectTimeout, configuredConnectTimeout);
    assertFalse("Connect timeout spec'd by URL didn't take", defaultConnectTimeout == configuredConnectTimeout);
  }

  public void testBug42267() throws Exception {
    MysqlDataSource ds = new MysqlDataSource();
    ds.setUrl(dbUrl);
    Connection conn = ds.getConnection();
    String query = "select 1,2,345";
    PreparedStatement ps = conn.prepareStatement(query);
    String psString = ps.toString();
    assertTrue("String representation of wrapped ps should contain query string", psString.endsWith(": " + query));
    ps.close();
View Full Code Here

   * 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

   * 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

   * 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

   * 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

            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

TOP

Related Classes of com.mysql.jdbc.jdbc2.optional.JDBC4PreparedStatementWrapper

Copyright © 2018 www.massapicom. 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.