public String toString() {
   if (isInstantiated()) {
     return "{" + getValue() + "}";
   } else {
     return "{"
         + Helper.getShortClassName(getClass())
         + ": "
         + ToStringLocalization.buildMessage("not_instantiated", (Object[]) null)
         + "}";
   }
 }
示例#2
0
 /** PUBLIC: Print all of the connection information. */
 public String toString() {
   StringWriter stringWriter = new StringWriter();
   PrintWriter writer = new PrintWriter(stringWriter);
   writer.write(Helper.getShortClassName(getClass()));
   writer.println("(");
   writer.println(
       "\t"
           + ToStringLocalization.buildMessage("platform", (Object[]) null)
           + "=> "
           + getDatasourcePlatform());
   if (!shouldUseExternalConnectionPooling()) {
     writer.println(
         "\t"
             + ToStringLocalization.buildMessage("user_name", (Object[]) null)
             + "=> \""
             + getUserName()
             + "\"");
   }
   writer.print("\t");
   getConnector().toString(writer);
   writer.write(")");
   return stringWriter.toString();
 }