Example usage for java.util Formatter close

List of usage examples for java.util Formatter close

Introduction

In this page you can find the example usage for java.util Formatter close.

Prototype

public void close() 

Source Link

Document

Closes this formatter.

Usage

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWSchema.java

public static String getTZDateString(Calendar val) {
    if (val == null) {
        return ("null");
    } else {//from  w  ww . ja v  a2 s  .  c  om
        Calendar db = CFLibDbUtil.getDbServerCalendar(val);
        StringBuffer buff = new StringBuffer();
        Formatter fmt = new Formatter(buff);
        fmt.format("%1$04d", db.get(Calendar.YEAR));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.MONTH) + 1);
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.DAY_OF_MONTH));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.HOUR_OF_DAY));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.MINUTE));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.SECOND));
        fmt.close();
        return (buff.toString());
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWSchema.java

public static String getTZTimeString(Calendar val) {
    if (val == null) {
        return ("null");
    } else {// w  w  w .  j  av a  2 s .c o m
        Calendar db = CFLibDbUtil.getDbServerCalendar(val);
        StringBuffer buff = new StringBuffer();
        Formatter fmt = new Formatter(buff);
        fmt.format("%1$04d", db.get(Calendar.YEAR));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.MONTH) + 1);
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.DAY_OF_MONTH));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.HOUR_OF_DAY));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.MINUTE));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.SECOND));
        fmt.close();
        return (buff.toString());
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWSchema.java

public static String getTZTimestampString(Calendar val) {
    if (val == null) {
        return ("null");
    } else {/*w  ww . j  av a  2 s .  co  m*/
        Calendar db = CFLibDbUtil.getDbServerCalendar(val);
        StringBuffer buff = new StringBuffer();
        Formatter fmt = new Formatter(buff);
        fmt.format("%1$04d", db.get(Calendar.YEAR));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.MONTH) + 1);
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.DAY_OF_MONTH));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.HOUR_OF_DAY));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.MINUTE));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.SECOND));
        fmt.close();
        return (buff.toString());
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccPgSql.CFAccPgSqlSchema.java

public static String getQuotedTimestampString(Calendar val) {
    if (val == null) {
        return ("null");
    } else {//from   ww  w .  j  a  v a  2  s.  c  o  m
        StringBuffer buff = new StringBuffer("'");
        Formatter fmt = new Formatter(buff);
        fmt.format("%1$04d", val.get(Calendar.YEAR));
        buff.append("-");
        fmt.format("%1$02d", val.get(Calendar.MONTH) + 1);
        buff.append("-");
        fmt.format("%1$02d", val.get(Calendar.DAY_OF_MONTH));
        buff.append(" ");
        fmt.format("%1$02d", val.get(Calendar.HOUR_OF_DAY));
        buff.append(":");
        fmt.format("%1$02d", val.get(Calendar.MINUTE));
        buff.append(":");
        fmt.format("%1$02d", val.get(Calendar.SECOND));
        buff.append("'");
        fmt.close();
        return (buff.toString());
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWSchema.java

public static String getQuotedTZDateString(Calendar val) {
    if (val == null) {
        return ("null");
    } else {/*from   www  . j  a  va  2 s.c o  m*/
        Calendar db = CFLibDbUtil.getDbServerCalendar(val);
        StringBuffer buff = new StringBuffer("'");
        Formatter fmt = new Formatter(buff);
        fmt.format("%1$04d", db.get(Calendar.YEAR));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.MONTH) + 1);
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.DAY_OF_MONTH));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.HOUR_OF_DAY));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.MINUTE));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.SECOND));
        buff.append("'");
        fmt.close();
        return (buff.toString());
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWSchema.java

public static String getQuotedTZTimeString(Calendar val) {
    if (val == null) {
        return ("null");
    } else {/*from  w w w.ja  va  2s  .  c  o  m*/
        Calendar db = CFLibDbUtil.getDbServerCalendar(val);
        StringBuffer buff = new StringBuffer("'");
        Formatter fmt = new Formatter(buff);
        fmt.format("%1$04d", db.get(Calendar.YEAR));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.MONTH) + 1);
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.DAY_OF_MONTH));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.HOUR_OF_DAY));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.MINUTE));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.SECOND));
        buff.append("'");
        fmt.close();
        return (buff.toString());
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWSchema.java

public static String getQuotedTZTimestampString(Calendar val) {
    if (val == null) {
        return ("null");
    } else {// ww  w.  j a v a 2 s . com
        Calendar db = CFLibDbUtil.getDbServerCalendar(val);
        StringBuffer buff = new StringBuffer("'");
        Formatter fmt = new Formatter(buff);
        fmt.format("%1$04d", db.get(Calendar.YEAR));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.MONTH) + 1);
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.DAY_OF_MONTH));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.HOUR_OF_DAY));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.MINUTE));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.SECOND));
        buff.append("'");
        fmt.close();
        return (buff.toString());
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWSchema.java

public static String getTimestampString(Calendar val) {
    if (val == null) {
        return ("null");
    } else {/*w ww . j a  v a 2  s  .  com*/
        StringBuffer buff = new StringBuffer();
        Formatter fmt = new Formatter(buff);
        Calendar db = CFLibDbUtil.getDbServerCalendar(val);
        fmt.format("%1$04d", db.get(Calendar.YEAR));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.MONTH) + 1);
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.DAY_OF_MONTH));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.HOUR_OF_DAY));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.MINUTE));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.SECOND));
        fmt.close();
        return (buff.toString());
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWSchema.java

public static String getQuotedTimestampString(Calendar val) {
    if (val == null) {
        return ("null");
    } else {/*from  w  w w  .ja v a  2s .c  o  m*/
        StringBuffer buff = new StringBuffer("'");
        Formatter fmt = new Formatter(buff);
        Calendar db = CFLibDbUtil.getDbServerCalendar(val);
        fmt.format("%1$04d", db.get(Calendar.YEAR));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.MONTH) + 1);
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.DAY_OF_MONTH));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.HOUR_OF_DAY));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.MINUTE));
        buff.append(".");
        fmt.format("%1$02d", db.get(Calendar.SECOND));
        buff.append("'");
        fmt.close();
        return (buff.toString());
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMSSql.CFAccMSSqlSchema.java

public static String getTZDateString(Calendar val) {
    if (val == null) {
        return ("null");
    } else {/*from   w w w .  ja  v  a 2  s . co  m*/
        Calendar db = CFLibDbUtil.getDbServerCalendar(val);
        StringBuffer buff = new StringBuffer();
        Formatter fmt = new Formatter(buff);
        fmt.format("%1$04d", db.get(Calendar.YEAR));
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.MONTH) + 1);
        buff.append("-");
        fmt.format("%1$02d", db.get(Calendar.DAY_OF_MONTH));
        buff.append(" ");
        fmt.format("%1$02d", db.get(Calendar.HOUR_OF_DAY));
        buff.append(":");
        fmt.format("%1$02d", db.get(Calendar.MINUTE));
        buff.append(":");
        fmt.format("%1$02d", db.get(Calendar.SECOND));
        fmt.close();
        return (buff.toString());
    }
}