com.poscoict.glueframework.dao.vo
Class GlueColumnDef

java.lang.Object
  extended by com.poscoict.glueframework.dao.vo.GlueColumnDef
All Implemented Interfaces:
Serializable

public class GlueColumnDef
extends Object
implements Serializable

µ¥ÀÌŸº£À̽º Á¶È¸°á°úÀÎ GlueRowSet ObjectÀÇ °¢ ColumnÇ׸ñÀÇ Á¤º¸¸¦ Á¦°øÇÏ´Â ClassÀÌ´Ù. ColumnÁ¤º¸¿¡´Â Name, Type, Length, Precision, ScaleÀÌ ÀÖ´Ù. ColumnÁ¤º¸¸¦ »ç¿ëÇϱâ À§Çؼ­´Â applicaitonContext.xmlÀÇ dao bean¼Ó¼º¿¡ ´ÙÀ½ÀÌ Ãß°¡µÇ¾î¾ß ÇÑ´Ù.

 1. applicationContext.xml ¿¹ 
 <bean id="testdao" class="com.poscoict.glueframework.dao.jdbc.GlueJdbcDao">
     <property name="dataSource" ref="dataSource"/>
     <property name="queryManager" ref="queryManager"/>
     <property name="columnDefCache" value="true" />
 </bean>
 
 2. Sample Code 
 GlueGenericDao dao = getDao("testdao"); 
 GlueRowSet rowSet = dao.findByQueryStatement("select * from EMP");
 GlueColumnDef[] def = rowSet.getColumnDefs();
 while(rowSet.hasNext())
 { 
     GlueRow row = rowSet.next();
     for(int i=0, iz=def.length; i < iz; i++)
     {
         System.out.println("ColumnDef - Name : "+def[i].getName());
         System.out.println("ColumnDef - Type : "+def[i].getType());
         System.out.println("ColumnDef - Length : "+def[i].getLength());
         System.out.println("ColumnDef - Precision : "+def[i].getPrecision());
         System.out.println("ColumnDef - Scale : "+def[i].getScale());
         System.out.println("Data : "+row.getAttribute(def[i].getName()));
     }
 }
 

See Also:
Serialized Form

Constructor Summary
GlueColumnDef(String name, int type, int length)
          »ý¼ºÀÚ(constructor).
GlueColumnDef(String name, int type, int length, int precision, int scale)
          »ý¼ºÀÚ(constructor).
 
Method Summary
 int getLength()
          Indicates the designated column's normal maximum width in characters.
 String getName()
          Get the designated column's name.
 int getPrecision()
          Get the designated column's number of decimal digits.
 int getScale()
          Gets the designated column's number of digits to right of the decimal point.
 int getType()
          Retrieves the designated column's SQL type.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GlueColumnDef

public GlueColumnDef(String name,
                     int type,
                     int length)
»ý¼ºÀÚ(constructor).

Parameters:
name -
type -
length -

GlueColumnDef

public GlueColumnDef(String name,
                     int type,
                     int length,
                     int precision,
                     int scale)
»ý¼ºÀÚ(constructor).

Parameters:
name -
type -
length -
precision -
scale -
Method Detail

getName

public String getName()
Get the designated column's name.
 ex) ´ÙÀ½°ú °°Àº sql¹®À̶ó¸é EMPNO, NAMEÀ» ¾òÀ»¼ö ÀÖ´Ù. 
 select empno, ename as name from emp
 

Returns:
column name

getType

public int getType()
Retrieves the designated column's SQL type.

Returns:
SQL type from java.sql.Types

getLength

public int getLength()
Indicates the designated column's normal maximum width in characters.

Returns:
the normal maximum number of characters allowed as the width of the designated column , or if type is BLOB or CLOB, then it returns -1

getPrecision

public int getPrecision()
Get the designated column's number of decimal digits.

Returns:
precision or -1(if BLOB or CLOB)

getScale

public int getScale()
Gets the designated column's number of digits to right of the decimal point.

Returns:
scale or -1(if BLOB or CLOB)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013–2016 POSCO ICT. All rights reserved.