Package sos.connection

Examples of sos.connection.SOSConnection

user=<username>

password=<password>

Copyright: Copyright (c) 2003

Company: SOS GmbH

@author Ghassan Beydoun @resource ojdbc14.jar sos.util.jar$Id: SOSConnection.java 14692 2011-06-28 10:32:06Z al $

   
    return conn;
  }
 
  private SOSConnection getConnectionFromINIFile(String settingsfile) throws Exception{
    SOSConnection conn = null;
    try {
     
      spooler_log.debug3("DB Connecting.. .");
      conn = SOSConnection.createInstance(settingsfile, new sos.util.SOSSchedulerLogger(spooler_log));     
      conn.connect();
      spooler_log.debug3("DB Connected");
     
    } catch (Exception e) {
      throw (new Exception("error in " + SOSClassUtil.getMethodName()
          + ": connect to database failed: " + e.toString()));
View Full Code Here


    dbProperty = dbProperty.substring(dbProperty.indexOf('-'));
    if (dbProperty.endsWith("-password="))
      dbProperty = dbProperty.substring(0, dbProperty.length() - 10);
    SOSArguments arguments = new SOSArguments(dbProperty);

    SOSConnection conn;
    if (log != null) {
      conn = SOSConnection.createInstance(schedulerSettings.getSection("spooler").getProperty("db_class"), arguments.as_string("-class=", ""),
          arguments.as_string("-url=", ""), arguments.as_string("-user=", ""), arguments.as_string("-password=", ""), log);
    }
    else {
View Full Code Here

  public void setSosSettingsFile(String sosSettingsFile) {
    this.sosSettingsFile = sosSettingsFile;
  }
 
  private SOSConnection getConnection() throws Exception{
    SOSConnection conn = null;
    if(sosString.parseToString(getSosSettingsFile()).length() > 0) {     
      conn = getConnectionFromINIFile();
    }
   
    if (conn == null) {
View Full Code Here

   
    return conn;
  }
 
  private SOSConnection getConnectionFromINIFile() throws Exception{
    SOSConnection conn = null;
    try {
     
      spooler_log.debug3("DB Connecting.. .");
      conn = SOSConnection.createInstance(getSosSettingsFile(), new sos.util.SOSSchedulerLogger(spooler_log));     
      conn.connect();
      spooler_log.debug3("DB Connected");
    } catch (Exception e) {
      throw (new Exception("error in " + SOSClassUtil.getMethodName()
          + ": connect to database failed: " + e.toString()));
    }
View Full Code Here

    }
 
  public boolean spooler_process() throws Exception {
       
    boolean new_connection=false;
    SOSConnection connection = this.getConnection();
   
    this.setLogger(new SOSSchedulerLogger(spooler_log));
       
    try{
      if (getJobProperties().getProperty("config") != null) {
            connection = sos.connection.SOSConnection.createInstance(getJobProperties().getProperty("config"));
              connection.connect();
            new_connection = true;
          } else {
                throw new Exception("no database connection has been configured by parameter [config]");
            }

    } catch (Exception e) {
      this.getLogger().error("error occurred checking database connection: "+e.getMessage());
      return false;
    } finally {
          if (new_connection && (connection != null)) {
              connection.disconnect();
              connection = null;
          }
      }

      return false;
View Full Code Here

TOP

Related Classes of sos.connection.SOSConnection

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.