try { if ( connection!=null ) connection.close(); connection = DriverManager.getConnection(properties.getProperty("url"), properties.getProperty("name"), properties.getProperty("password")); savedException = null; } catch (SQLException e) { connection = null; savedException = new PublisherException("Exception during initialization caused by "+e.getMessage()); savedException.initCause(e); log.error("not possible to get sql coennection", e); } if ( connection!=null && savedException==null ) { final String sqlCommand  = "CREATE TABLE CertificateData ( "+ "fingerprint varchar(250) binary NOT NULL default '', "+ "base64Cert text, "+ "subjectDN varchar(250) binary default NULL, "+ "issuerDN varchar(250) binary default NULL, "+ "cAFingerprint varchar(250) binary default NULL, "+ "serialNumber varchar(250) binary default NULL, "+ "status int(11) NOT NULL default '0', "+ "type int(11) NOT NULL default '0', "+ "username varchar(250) binary default NULL, "+ "expireDate bigint(20) NOT NULL default '0', "+ "revocationDate bigint(20) NOT NULL default '0', "+ "revocationReason int(11) NOT NULL default '0', "+ "PRIMARY KEY  (fingerprint) ) TYPE=MyISAM;"; try { execute(sqlCommand); } catch (PublisherException e) { log.debug("Table allready created.",e); } }
dataSource = properties.getProperty("dataSource"); log.debug("dataSource='"+dataSource+"'.");
    public void init(Properties properties) {        try {            if ( connection!=null )                connection.close();            connection = DriverManager.getConnection(properties.getProperty("url"),                                                     properties.getProperty("name"),                                                     properties.getProperty("password"));            savedException = null;        } catch (SQLException e) {            connection = null;            savedException = new PublisherException("Exception during initialization caused by "+e.getMessage());            savedException.initCause(e);            log.error("not possible to get sql coennection", e);        }        if ( connection!=null && savedException==null ) {            final String sqlCommand  =                "CREATE TABLE CertificateData ( "+                "fingerprint varchar(250) binary NOT NULL default '', "+                "base64Cert text, "+                "subjectDN varchar(250) binary default NULL, "+                "issuerDN varchar(250) binary default NULL, "+                "cAFingerprint varchar(250) binary default NULL, "+                "serialNumber varchar(250) binary default NULL, "+                "status int(11) NOT NULL default '0', "+                "type int(11) NOT NULL default '0', "+                "username varchar(250) binary default NULL, "+                "expireDate bigint(20) NOT NULL default '0', "+                "revocationDate bigint(20) NOT NULL default '0', "+                "revocationReason int(11) NOT NULL default '0', "+                "PRIMARY KEY  (fingerprint) ) TYPE=MyISAM;";            try {                execute(sqlCommand);            } catch (PublisherException e) {                log.debug("Table allready created.",e);            }        }    }