public void initConnection()
    {
        try   {
            boolean bAutoCommit = true;
            if (DBConstants.FALSE.equalsIgnoreCase(this.getProperty(SQLParams.AUTO_COMMIT_PARAM)))
                bAutoCommit = false;
            m_JDBCConnection.setAutoCommit(bAutoCommit);
            DatabaseMetaData dma = m_JDBCConnection.getMetaData();
            String strDatabaseProductName = dma.getDatabaseProductName();
            Utility.getLogger().info("DB Name: " + strDatabaseProductName);
            this.setProperty(SQLParams.INTERNAL_DB_NAME, strDatabaseProductName);
            this.setupDatabaseProperties(); // If I haven't read the db properties, read them now!
            String strDateQuote = this.getProperty(SQLParams.SQL_DATE_QUOTE);
            if ((strDateQuote != null) && (strDateQuote.length() > 0))
                DateTimeField.setSQLQuote(strDateQuote.charAt(0));
            Converter.initGlobals();
            String strFormat = this.getProperty(SQLParams.SQL_DATE_FORMAT);
            if (strFormat != null)
                Converter.gDateSqlFormat = new java.text.SimpleDateFormat(strFormat);
            strFormat = this.getProperty(SQLParams.SQL_TIME_FORMAT);
            if (strFormat != null)
                Converter.gTimeSqlFormat = new java.text.SimpleDateFormat(strFormat);
            strFormat = this.getProperty(SQLParams.SQL_DATETIME_FORMAT);
            if (strFormat != null)
                Converter.gDateTimeSqlFormat = new java.text.SimpleDateFormat(strFormat);
            if (DBConstants.TRUE.equals(this.getProperty(SQLParams.SHARE_JDBC_CONNECTION)))
                m_sharedConnection = m_JDBCConnection;  // HACK - Only one DB open at a time (pointbase)!
            Utility.getLogger().info("Connected to db: " + this.getDatabaseName(true));
        }
        catch (SQLException ex)
        {
            // Ignore errors to these non-essential calls;  // Probably "DB Not found"
        }
    }
public void initConnection ( ) { try { boolean bAutoCommit = true ; if ( DBConstants . FALSE . equalsIgnoreCase ( this . getProperty ( SQLParams . AUTO_COMMIT_PARAM ) ) ) bAutoCommit = false ; m_JDBCConnection . setAutoCommit ( bAutoCommit ) ; DatabaseMetaData dma = m_JDBCConnection . getMetaData ( ) ; String strDatabaseProductName = dma . getDatabaseProductName ( ) ; Utility . getLogger ( ) . info ( "DB Name: " + strDatabaseProductName ) ; this . setProperty ( SQLParams . INTERNAL_DB_NAME , strDatabaseProductName ) ; this . setupDatabaseProperties ( ) ; String strDateQuote = this . getProperty ( SQLParams . SQL_DATE_QUOTE ) ; if ( ( strDateQuote != null ) && ( strDateQuote . length ( ) > 0 ) ) DateTimeField . setSQLQuote ( strDateQuote . charAt ( 0 ) ) ; Converter . initGlobals ( ) ; String strFormat = this . getProperty ( SQLParams . SQL_DATE_FORMAT ) ; if ( strFormat != null ) Converter . gDateSqlFormat = new java . text . SimpleDateFormat ( strFormat ) ; strFormat = this . getProperty ( SQLParams . SQL_TIME_FORMAT ) ; if ( strFormat != null ) Converter . gTimeSqlFormat = new java . text . SimpleDateFormat ( strFormat ) ; strFormat = this . getProperty ( SQLParams . SQL_DATETIME_FORMAT ) ; if ( strFormat != null ) Converter . gDateTimeSqlFormat = new java . text . SimpleDateFormat ( strFormat ) ; if ( DBConstants . TRUE . equals ( this . getProperty ( SQLParams . SHARE_JDBC_CONNECTION ) ) ) m_sharedConnection = m_JDBCConnection ; Utility . getLogger ( ) . info ( "Connected to db: " + this . getDatabaseName ( true ) ) ; } catch ( SQLException ex ) { } }
Setup the new connection.