Package org.jallinone.startup.java

Examples of org.jallinone.startup.java.DbConnVO


    if (pos==0) {
      cardLayout1.show(mainPanel,"DB");
      pos++;
    }
    else if (pos==1) {
      DbConnVO vo = createConn();
      vo.setCheckDbVersion(true);
      Response res = ClientUtils.getData("createConfigFile",vo);
      if (!res.isError()) {
        Boolean b = (Boolean)((VOResponse)res).getVo();
        if (b.booleanValue()) {
View Full Code Here


  /**
   * Create config.xml file on server side and try to connect to it.
   */
  private DbConnVO createConn() {
    DbConnVO dbConnVO = new DbConnVO();
    if (dbTypeComboBox.getSelectedIndex()==0) {
      // Oracle database...
      dbConnVO.setDriverName("oracle.jdbc.driver.OracleDriver");
      dbConnVO.setPassword(passwordTF.getText().trim());
      dbConnVO.setUsername(usernameTF.getText().trim());
      dbConnVO.setUrl("jdbc:oracle:thin:@"+hostTF.getText().trim()+":"+portTF.getText().trim()+":"+sidTF.getText().trim());
    }
    else if (dbTypeComboBox.getSelectedIndex()==1) {
      // MS SqlServer database...
      dbConnVO.setDriverName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
      dbConnVO.setPassword(passwordTF.getText().trim());
      dbConnVO.setUsername(usernameTF.getText().trim());
      if (portTF.getText().trim().length()>0)
        dbConnVO.setUrl("jdbc:microsoft:sqlserver://"+hostTF.getText().trim()+":"+portTF.getText().trim()+";DatabaseName="+sidTF.getText().trim()+";SelectMethod=cursor");
      else
        dbConnVO.setUrl("jdbc:microsoft:sqlserver://"+hostTF.getText().trim()+";DatabaseName="+sidTF.getText().trim()+";SelectMethod=cursor");
    }
    else if (dbTypeComboBox.getSelectedIndex()==2) {
      // MS SqlServer database...
      dbConnVO.setDriverName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
      dbConnVO.setPassword(passwordTF.getText().trim());
      dbConnVO.setUsername(usernameTF.getText().trim());
      if (portTF.getText().trim().length()>0)
        dbConnVO.setUrl("jdbc:sqlserver://"+hostTF.getText().trim()+":"+portTF.getText().trim()+";DatabaseName="+sidTF.getText().trim()+";SelectMethod=cursor");
      else
        dbConnVO.setUrl("jdbc:sqlserver://"+hostTF.getText().trim()+";DatabaseName="+sidTF.getText().trim()+";SelectMethod=cursor");
    }
    else if (dbTypeComboBox.getSelectedIndex()==3) {
      // MySQL database...
      dbConnVO.setDriverName("com.mysql.jdbc.Driver");
      dbConnVO.setPassword(passwordTF.getText().trim());
      dbConnVO.setUsername(usernameTF.getText().trim());
       String jdbcUrl = null;
        if (portTF.getText().trim().length()>0)
         jdbcUrl =  "jdbc:mysql://"+hostTF.getText().trim()+":"+portTF.getText().trim()+"/"+sidTF.getText().trim();
      else
        jdbcUrl =  "jdbc:mysql://"+hostTF.getText().trim()+"/"+sidTF.getText().trim();
      if (unicodeCheckBox.isSelected())
        jdbcUrl += "?characterEncoding=UTF-8&useUnicode=true";
      dbConnVO.setUrl(jdbcUrl);
    }
    else if (dbTypeComboBox.getSelectedIndex()==4) {
      // other database...
      dbConnVO.setDriverName(driverTF.getText().trim());
      dbConnVO.setPassword(otherPasswdTF.getText().trim());
      dbConnVO.setUsername(otherUsernameTF.getText().trim());
      dbConnVO.setUrl(urlTF.getText().trim());
    }
    return dbConnVO;
  }
View Full Code Here

  /**
   * Create database structures and save initial data.
   */
  private boolean saveSettings() {
    DbConnVO dbConnVO = createConn();
    dbConnVO.setCompanyCode(companyCodeTF.getText().trim());
    dbConnVO.setCompanyDescription(companyDescrTF.getText().trim());
    dbConnVO.setLanguageCode(languageCodeTF.getText().trim());
    dbConnVO.setLanguageDescription(languageDescrTF.getText().trim());
    dbConnVO.setCurrencyCodeREG03(currencyCodeTF.getText().toUpperCase().trim());
    dbConnVO.setCurrencySymbolREG03(symbTF.getText().trim().length()>3?symbTF.getText().trim().substring(0,3):symbTF.getText().trim());
    dbConnVO.setDecimalsREG03(new BigDecimal(decTF.getText().trim()));
    dbConnVO.setDecimalSymbolREG03(decSymTF.getText().trim().substring(0,1));
    dbConnVO.setThousandSymbolREG03(thTF.getText().trim().substring(0,1));

    if (controlVar1.getValue()==null || controlVar1.getValue().toString().trim().equals(""))
        dbConnVO.setVariant1("*");
    else
      dbConnVO.setVariant1(controlVar1.getValue().toString().trim());

    if (controlVar2.getValue()==null || controlVar2.getValue().toString().trim().equals(""))
        dbConnVO.setVariant2("*");
    else
      dbConnVO.setVariant2(controlVar2.getValue().toString().trim());

    if (controlVar3.getValue()==null || controlVar3.getValue().toString().trim().equals(""))
        dbConnVO.setVariant3("*");
    else
      dbConnVO.setVariant3(controlVar3.getValue().toString().trim());

    if (controlVar4.getValue()==null || controlVar4.getValue().toString().trim().equals(""))
        dbConnVO.setVariant4("*");
    else
      dbConnVO.setVariant4(controlVar4.getValue().toString().trim());

    if (controlVar5.getValue()==null || controlVar5.getValue().toString().trim().equals(""))
        dbConnVO.setVariant5("*");
    else
      dbConnVO.setVariant5(controlVar5.getValue().toString().trim());

    dbConnVO.setUseVariantType1(varCheckBox1.isSelected()?"Y":"N");
    dbConnVO.setUseVariantType2(varCheckBox2.isSelected()?"Y":"N");
    dbConnVO.setUseVariantType3(varCheckBox3.isSelected()?"Y":"N");
    dbConnVO.setUseVariantType4(varCheckBox4.isSelected()?"Y":"N");
    dbConnVO.setUseVariantType5(varCheckBox5.isSelected()?"Y":"N");

    if (clientLanguageCodeComboBox.getSelectedIndex()==0)
      dbConnVO.setClientLanguageCode("EN");
    else if (clientLanguageCodeComboBox.getSelectedIndex()==1)
      dbConnVO.setClientLanguageCode("IT");
    else if (clientLanguageCodeComboBox.getSelectedIndex()==2)
      dbConnVO.setClientLanguageCode("ES");
    else if (clientLanguageCodeComboBox.getSelectedIndex()==3)
      dbConnVO.setClientLanguageCode("PTBR");
    else if (clientLanguageCodeComboBox.getSelectedIndex()==4)
      dbConnVO.setClientLanguageCode("DE");
    else if (clientLanguageCodeComboBox.getSelectedIndex()==5)
      dbConnVO.setClientLanguageCode("HR");
    else
      dbConnVO.setClientLanguageCode("RU");
    dbConnVO.setAdminPassword(adminPasswdTF.getText().trim());
    Response response = ClientUtils.getData("createConfigFile",dbConnVO);
    if (response.isError()) {
      JOptionPane.showMessageDialog(
          this,
          response.getErrorMessage(),
View Full Code Here

                                 HttpServletRequest httpServletRequest,
                                 HttpServletResponse httpServletResponse,
                                 HttpSession httpSession,
                                 ServletContext servletContext) {
    try {
      DbConnVO vo = (DbConnVO)inputPars;
      return createConfigFile(vo,"ADMIN");
    }
    catch (Throwable ex) {
      Logger.error(null,this.getClass().getName(),"executeCommand","Error while processing request",ex);
      return new ErrorResponse(ex.getMessage());
View Full Code Here

TOP

Related Classes of org.jallinone.startup.java.DbConnVO

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.