org.apache.cocoon.components.language.markup.xsp
Class EsqlHelper

java.lang.Object
  extended by org.apache.cocoon.components.language.markup.xsp.EsqlHelper

public class EsqlHelper
extends Object

This is a helper class to remove redundant code in esql pages. Based on the orginal esql.xsl.

Version:
CVS $Id: EsqlHelper.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Torsten Curdt

Constructor Summary
EsqlHelper()
           
 
Method Summary
static String getAscii(CallableStatement cs, int column, String defaultString)
          returns ascii string from CLOB or String column
static String getAscii(ResultSet set, int column, String defaultString)
          returns ascii string from CLOB or String column
static String getAscii(ResultSet set, String column, String defaultString)
          returns ascii string from CLOB or String column
static byte[] getBlob(CallableStatement cs, int column, String defaultString)
          returns byte array from BLOB
static byte[] getBlob(ResultSet set, int column)
          returns byte array from BLOB
static byte[] getBlob(ResultSet set, String column)
          returns byte array from BLOB
static String getStringFromByteArray(byte[] bytes, String encoding, String defaultString)
           
static String getStringOrClob(CallableStatement cs, int column, String defaultString)
          returns Unicode encoded string from CLOB or String column
static String getStringOrClob(ResultSet set, int column, String defaultString)
          returns Unicode encoded string from CLOB or String column
static String getStringOrClob(ResultSet set, String column, String defaultString)
          returns Unicode encoded string from CLOB or String column
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EsqlHelper

public EsqlHelper()
Method Detail

getBlob

public static byte[] getBlob(ResultSet set,
                             String column)
                      throws RuntimeException
returns byte array from BLOB

Throws:
RuntimeException

getBlob

public static byte[] getBlob(ResultSet set,
                             int column)
                      throws Exception
returns byte array from BLOB

Throws:
Exception

getBlob

public static byte[] getBlob(CallableStatement cs,
                             int column,
                             String defaultString)
                      throws Exception
returns byte array from BLOB

Throws:
Exception

getStringOrClob

public static String getStringOrClob(ResultSet set,
                                     String column,
                                     String defaultString)
                              throws RuntimeException
returns Unicode encoded string from CLOB or String column

Throws:
RuntimeException

getStringOrClob

public static String getStringOrClob(ResultSet set,
                                     int column,
                                     String defaultString)
                              throws Exception
returns Unicode encoded string from CLOB or String column

Throws:
Exception

getStringOrClob

public static String getStringOrClob(CallableStatement cs,
                                     int column,
                                     String defaultString)
                              throws Exception
returns Unicode encoded string from CLOB or String column

Throws:
Exception

getAscii

public static String getAscii(ResultSet set,
                              String column,
                              String defaultString)
                       throws RuntimeException
returns ascii string from CLOB or String column

Throws:
RuntimeException

getAscii

public static String getAscii(ResultSet set,
                              int column,
                              String defaultString)
returns ascii string from CLOB or String column


getAscii

public static String getAscii(CallableStatement cs,
                              int column,
                              String defaultString)
returns ascii string from CLOB or String column


getStringFromByteArray

public static String getStringFromByteArray(byte[] bytes,
                                            String encoding,
                                            String defaultString)


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.