Package sos.connection

Examples of sos.connection.SOSConnection.connect()


   
    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 if (getJobProperties().getProperty("database") != null) {
              database = getJobProperties().getProperty("database").toString();
              if (database != null && database.length()>0) connection.execute("USE " + database);
              getLogger().info("database changed to: " + database);
View Full Code Here


                                                      slaveProperties.getProperty("password") );
            } else {
                slaveConnection = SOSConnection.createInstance(connectionSettingsFilename, (SOSLogger) new SOSSchedulerLogger(spooler_log));
                slaveProperties.setProperty("url", slaveConnection.getUrl());
            }
            slaveConnection.connect();
        }
        catch (Exception e) {
            sosLogger.error("connect to database failed for slave no. " + this.sosCounter + ": " + e.getMessage());
            return true; // proceed with next slave instance
        }
View Full Code Here

            if(userJob){
              checkOldTempUsers();
              localConnection=this.getUserConnection(orderPayload.var("scheduler_order_user_name"), orderPayload.var("scheduler_order_schema"));
            }else{
              localConnection = JobSchedulerManagedObject.getOrderConnection(this.getConnection(), this);
              localConnection.connect();
            }
          } catch (Exception e) {
            throw new Exception("error occurred establishing database connection: " + e.getMessage());
          }
         
View Full Code Here

           
      }   
      catch (Exception e) {
          throw new Exception("error occurred establishing database connection: " + e.getMessage());
      }
      userConnection.connect();
      if (schema!=null && schema.length()>0) userConnection.execute("use "+schema);
      userConnection.commit();
    return userConnection;
   
  }
View Full Code Here

   
    //db= jdbc -class=com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc:sqlserver://8of9:2433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=ehp_bkk -user=ehp_bkk -password=ehp_bkk
   
    //SOSConnection conn = SOSConnection.createInstance("SOSMySQLConnection","com.mysql.jdbc.Driver","jdbc:mysql://wilma.sos:3305/scheduler", "scheduler", "scheduler",logger);
    SOSConnection conn = SOSConnection.createInstance("SOSMSSQLConnection","com.microsoft.sqlserver.jdbc.SQLServerDriver","jdbc:sqlserver://8of9:2433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=ehp_bkk", "ehp_bkk", "ehp_bkk",logger);
    conn.connect();
    SOSSettings settings = new SOSConnectionSettings(conn,"SETTINGS", logger);
    SOSMailOrder order = new SOSMailOrder(settings, conn);   
    order.setSOSLogger(logger);
    order.addRecipient(mailto);
    order.setLanguage("en");
View Full Code Here

      SOSLogger log = new SOSStandardLogger(SOSLogger.DEBUG9);
      SOSConnection conn = SOSConnection.createInstance("j:/e/java/al/sos.scheduler/config/sos_setup_settings.ini", log);
      //setLogger(log);
      try{
     
      conn.connect();
    String xml = conn.getClob("SELECT \"XML\" FROM SCHEDULER_MANAGED_OBJECTS WHERE \"ID\" = 347");
   
      try  {
        updateSchedulerFile(xml, "New_job_documentation.xml", SOSDate.getCurrentTimeAsString(), "documentation");
         
View Full Code Here

            // template sample with settings
            // .. create logger
            SOSStandardLogger logger = new SOSStandardLogger(9);
            // .. create connection
            SOSConnection connection = SOSConnection.createInstance("/scheduler/config/sos_settings.ini", logger);
            connection.connect();
            // .. create settings instance from connection
            SOSConnectionSettings settings = new
            SOSConnectionSettings( connection,          // connection instance
                                  "SETTINGS",           // settings table
                                  logger);
View Full Code Here

            // template sample with settings
            // .. create logger
            SOSStandardLogger logger = new SOSStandardLogger(9);
            // .. create connection
            SOSConnection connection = SOSConnection.createInstance("/scheduler/config/sos_settings.ini", logger);
            connection.connect();
            // .. create settings instance from connection
            SOSConnectionSettings settings = new
            SOSConnectionSettings( connection,          // connection instance
                                  "SETTINGS",           // settings table
                                  logger);
View Full Code Here

      try {

        System.out.println("DB Connecting.. .");
        sosConnection = SOSConnection.createInstance(iniSOSConnectionFile, sosLogger);
        sosConnection.connect();
        System.out.println("DB Connected");
      }
      catch (Exception e) {
        System.out.print(e.toString());
      }
View Full Code Here

    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

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.