org.seasar.extension.jdbc.util
クラス BindVariableUtil

java.lang.Object
  拡張org.seasar.extension.jdbc.util.BindVariableUtil

public final class BindVariableUtil
extends Object

バインド変数用のユーティリティです。

作成者:
higa

メソッドの概要
protected static void addDate(SStringBuilder buf, Calendar calendar)
          文字列バッファにyyyy-mm-ddのフォーマットで日付を設定します。
protected static void addTime(SStringBuilder buf, Calendar calendar)
          文字列バッファにhh:mm:ssのフォーマットで値を設定します。
protected static void addTimeDecimalPart(SStringBuilder buf, int decimalPart)
          文字列バッファに時間の小数点以下の値を設定します。
static String getBindVariableText(Object bindVariable)
          バインド変数を文字列として返します。
static String getBindVariableText(Object bindVariable, ValueType valueType)
          バインド変数を文字列として返します。
static String getCompleteSql(String sql, Object[] args)
          バインド変数をSQLの中にリテラルで埋め込んだ完全なSQLを返します。
static String getCompleteSql(String sql, Object[] args, ValueType[] valueTypes)
          バインド変数をSQLの中にリテラルで埋め込んだ完全なSQLを返します。
static String nullText()
          nullの文字列表現を返します。
protected static String quote(String text)
          文字列をシングルクォートで囲みます。
static String toText(Boolean value)
          Booleanの文字列表現を返します。
static String toText(byte[] value)
          byte[]の文字列表現を返します。
static String toText(Date value)
          Dateの文字列表現を返します。
static String toText(Number value)
          Numberの文字列表現を返します。
static String toText(Object value)
          Objectの文字列表現を返します。
static String toText(String value)
          Stringの文字列表現を返します。
static String toText(Time value)
          Timeの文字列表現を返します。
static String toText(Timestamp value)
          Timestampの文字列表現を返します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

getCompleteSql

public static String getCompleteSql(String sql,
                                    Object[] args)
バインド変数をSQLの中にリテラルで埋め込んだ完全なSQLを返します。

パラメータ:
sql - SQL
args - 引数
戻り値:
バインド変数をSQLの中にリテラルで埋め込んだ完全なSQL

getCompleteSql

public static String getCompleteSql(String sql,
                                    Object[] args,
                                    ValueType[] valueTypes)
バインド変数をSQLの中にリテラルで埋め込んだ完全なSQLを返します。

パラメータ:
sql - SQL
args - 引数
valueTypes - 値タイプの配列
戻り値:
バインド変数をSQLの中にリテラルで埋め込んだ完全なSQL

getBindVariableText

public static String getBindVariableText(Object bindVariable)
バインド変数を文字列として返します。

パラメータ:
bindVariable - バインド変数
戻り値:
バインド変数の文字列表現

getBindVariableText

public static String getBindVariableText(Object bindVariable,
                                         ValueType valueType)
バインド変数を文字列として返します。

パラメータ:
bindVariable - バインド変数
valueType - 値タイプ
戻り値:
バインド変数の文字列表現

nullText

public static String nullText()
nullの文字列表現を返します。

戻り値:

toText

public static String toText(Number value)
Numberの文字列表現を返します。

パラメータ:
value - 値
戻り値:
文字列表現

toText

public static String toText(Boolean value)
Booleanの文字列表現を返します。

パラメータ:
value - 値
戻り値:
文字列表現

toText

public static String toText(String value)
Stringの文字列表現を返します。

パラメータ:
value - 値
戻り値:
文字列表現

toText

public static String toText(Date value)
Dateの文字列表現を返します。

パラメータ:
value - 値
戻り値:
文字列表現

toText

public static String toText(Time value)
Timeの文字列表現を返します。

パラメータ:
value - 値
戻り値:
文字列表現

toText

public static String toText(Timestamp value)
Timestampの文字列表現を返します。

パラメータ:
value - 値
戻り値:
文字列表現

toText

public static String toText(byte[] value)
byte[]の文字列表現を返します。

パラメータ:
value - 値
戻り値:
文字列表現

toText

public static String toText(Object value)
Objectの文字列表現を返します。

パラメータ:
value - 値
戻り値:
文字列表現

addDate

protected static void addDate(SStringBuilder buf,
                              Calendar calendar)
文字列バッファにyyyy-mm-ddのフォーマットで日付を設定します。

パラメータ:
buf - 文字列バッファ
calendar - カレンダ

addTime

protected static void addTime(SStringBuilder buf,
                              Calendar calendar)
文字列バッファにhh:mm:ssのフォーマットで値を設定します。

パラメータ:
buf - 文字列バッファ
calendar - カレンダ

addTimeDecimalPart

protected static void addTimeDecimalPart(SStringBuilder buf,
                                         int decimalPart)
文字列バッファに時間の小数点以下の値を設定します。

パラメータ:
buf - 文字列バッファ
decimalPart - 小数点以下の値

quote

protected static String quote(String text)
文字列をシングルクォートで囲みます。

パラメータ:
text - 文字列
戻り値:


Copyright ? 2004-2007 The Seasar Foundation. All Rights Reserved.