Package org.apache.derby.iapi.tools.i18n

Examples of org.apache.derby.iapi.tools.i18n.LocalizedResource


    private void init() throws Exception
    {

        // adjust the application in accordance with derby.ui.locale and derby.ui.codeset
    langUtil = new LocalizedResource(null,null,DRDA_PROP_MESSAGES);

    serverInstance = this;
   
    //set Server attributes to be used in EXCSAT
    ProductVersionHolder myPVH = getNetProductVersionHolder();
View Full Code Here


      int localeLen = reader.readByte();
      if (localeLen > 0)
      {
        currentSession = session;
        locale = reader.readCmdString(localeLen);
        session.langUtil = new LocalizedResource(codeset,locale,DRDA_PROP_MESSAGES);
      }
      String notLocalMessage = null;
      // for now codesetLen is always 0
      int codesetLen = reader.readByte();
      int command = reader.readByte();
View Full Code Here

   * @return system information for the Network Server
   */
  private String getNetSysInfo()
  {
    StringBuffer sysinfo = new StringBuffer();
    LocalizedResource localLangUtil = langUtil;
    if (currentSession != null && currentSession.langUtil != null)
    localLangUtil = currentSession.langUtil;
    sysinfo.append(localLangUtil.getTextMessage("DRDA_SysInfoBanner.I")+ "\n");
    sysinfo.append(localLangUtil.getTextMessage("DRDA_SysInfoVersion.I")+ " " + att_srvrlslv);
    sysinfo.append("  ");
    sysinfo.append(localLangUtil.getTextMessage("DRDA_SysInfoBuild.I")+ " " + buildNumber);
    sysinfo.append("  ");
    sysinfo.append(localLangUtil.getTextMessage("DRDA_SysInfoDrdaPRDID.I")+ " " + prdId);
    if (SanityManager.DEBUG)
    {
      sysinfo.append("  ** SANE BUILD **");
    }
    sysinfo.append("\n");
 
View Full Code Here

   * @throws IOException if a problem occurs encoding string
   */
  private String getCLSSysInfo() throws IOException
  {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    LocalizedResource localLangUtil = langUtil;
    if (currentSession != null && currentSession.langUtil != null)
    localLangUtil = currentSession.langUtil;
    LocalizedOutput aw = localLangUtil.getNewOutput(bos);
    org.apache.derby.impl.tools.sysinfo.Main.getMainInfo(aw, false);
    return bos.toString();
  }
View Full Code Here

    private void init() throws Exception
    {

        // adjust the application in accordance with derby.ui.locale and derby.ui.codeset
    langUtil = new LocalizedResource(null,null,DRDA_PROP_MESSAGES);

    serverInstance = this;
   
    //set Server attributes to be used in EXCSAT
    ProductVersionHolder myPVH = getNetProductVersionHolder();
View Full Code Here

      int localeLen = reader.readByte();
      if (localeLen > 0)
      {
        currentSession = session;
        locale = reader.readCmdString(localeLen);
        session.langUtil = new LocalizedResource(codeset,locale,DRDA_PROP_MESSAGES);
      }
      String notLocalMessage = null;
      // for now codesetLen is always 0
      int codesetLen = reader.readByte();
      int command = reader.readByte();
View Full Code Here

   * @return system information for the Network Server
   */
  private String getNetSysInfo()
  {
    StringBuffer sysinfo = new StringBuffer();
    LocalizedResource localLangUtil = langUtil;
    if (currentSession != null && currentSession.langUtil != null)
    localLangUtil = currentSession.langUtil;
    sysinfo.append(localLangUtil.getTextMessage("DRDA_SysInfoBanner.I")+ "\n");
    sysinfo.append(localLangUtil.getTextMessage("DRDA_SysInfoVersion.I")+ " " + att_srvrlslv);
    sysinfo.append("  ");
    sysinfo.append(localLangUtil.getTextMessage("DRDA_SysInfoBuild.I")+ " " + buildNumber);
    sysinfo.append("  ");
    sysinfo.append(localLangUtil.getTextMessage("DRDA_SysInfoDrdaPRDID.I")+ " " + prdId);
    if (SanityManager.DEBUG)
    {
      sysinfo.append("  ** SANE BUILD **");
    }
    sysinfo.append("\n");
 
View Full Code Here

   * @throws IOException if a problem occurs encoding string
   */
  private String getCLSSysInfo() throws IOException
  {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    LocalizedResource localLangUtil = langUtil;
    if (currentSession != null && currentSession.langUtil != null)
    localLangUtil = currentSession.langUtil;
    LocalizedOutput aw = localLangUtil.getNewOutput(bos);
    org.apache.derby.impl.tools.sysinfo.Main.getMainInfo(aw, false);
    return bos.toString();
  }
View Full Code Here

       Print the usage statement if the user didn't enter a valid choice
       of tool.
   */
  public static void printUsage()
  {
      LocalizedResource locRes = LocalizedResource.getInstance();
      System.err.println(locRes.getTextMessage("RUN_Usage"));
  }
View Full Code Here

    String file;
    String inputResourceName;
    boolean gotProp;
    Properties connAttributeDefaults = null;

    LocalizedResource langUtil = LocalizedResource.getInstance();
    LocalizedOutput out = langUtil.getNewOutput(System.out);

                // Validate arguments, check for --help.
    if (util.invalidArgs(args)) {
      util.Usage(out);
          return;
    }

    // load the property file if specified
    gotProp = util.getPropertyArg(args);

    // get the default connection attributes
    connAttributeDefaults = util.getConnAttributeArg(args);

    // readjust output to derby.ui.locale and derby.ui.codeset if
                // they were loaded from a property file.
    langUtil.init();
    out = langUtil.getNewOutput(System.out);
                main.initAppUI();

    file = util.getFileArg(args);
    inputResourceName = util.getInputResourceNameArg(args);
    if (inputResourceName != null) {
      in = langUtil.getNewInput(util.getResourceAsStream(inputResourceName));
      if (in == null) {
        out.println(langUtil.getTextMessage("IJ_IjErroResoNo",inputResourceName));
        return;
      }
    } else if (file == null) {
      in = langUtil.getNewInput(System.in);
                        out.flush();
              } else {
                    try {
                        in1 = new FileInputStream(file);
                        if (in1 != null) {
                            in1 = new BufferedInputStream(in1, utilMain.BUFFEREDFILESIZE);
                            in = langUtil.getNewInput(in1);
                        }
                    } catch (FileNotFoundException e) {
                        if (Boolean.getBoolean("ij.searchClassPath")) {
                            in = langUtil.getNewInput(util.getResourceAsStream(file));
                        }
                        if (in == null) {
                        out.println(langUtil.getTextMessage("IJ_IjErroFileNo",file));
                  return;
                        }
                    }
                }

    String outFile = util.getSystemProperty("ij.outfile");
    if (outFile != null && outFile.length()>0) {
      LocalizedOutput oldOut = out;
      try {
        out = langUtil.getNewOutput(new FileOutputStream(outFile));
      }
      catch (IOException ioe) {
        oldOut.println(langUtil.getTextMessage("IJ_IjErroUnabTo",outFile));
      }
    }

    // the old property name is deprecated...
    String maxDisplayWidth = util.getSystemProperty("maximumDisplayWidth");
    if (maxDisplayWidth==null)
      maxDisplayWidth = util.getSystemProperty("ij.maximumDisplayWidth");
    if (maxDisplayWidth != null && maxDisplayWidth.length() > 0) {
      try {
        int maxWidth = Integer.parseInt(maxDisplayWidth);
        JDBCDisplayUtil.setMaxDisplayWidth(maxWidth);
      }
      catch (NumberFormatException nfe) {
        out.println(langUtil.getTextMessage("IJ_IjErroMaxiVa", maxDisplayWidth));
      }
    }

    /* Use the main parameter to get to
     * a new Main that we can use. 
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.tools.i18n.LocalizedResource

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.