public class GlueJdbcDao extends org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport implements GlueGenericJdbcDao
Bean Property - dataSource : (Çʼö) javax.sql.DataSource - queryManager : (Çʼö) com.poscoict.glueframework.dao.manager.GlueQueryManager - columnManager : (¼±ÅÃ) com.poscoict.glueframework.dao.manager.GlueColumnManager, default´Â null - sequence : (¼±ÅÃ) com.poscoict.glueframework.dao.sequence.GlueSequence, default´Â ÀÚµ¿»ý¼ºµÇ³ª Áö¿øµÇ´Â DB°¡ Á¦ÇÑÀûÀÓ. - lobHandler (¼±ÅÃ) org.springframework.jdbc.support.lob.LobHandler, default´Â org.springframework.jdbc.support.lob.DefaultLobHandler - typeCast : (¼±ÅÃ) boolean( true, false ), default´Â falseÀÓ. - batchUpdateLimit : (¼±ÅÃ) int, default´Â 30000 - fetchSize : (¼±ÅÃ) int, default 0 ¿¹Á¦»ç¿ë ¿¹# 1
Modifier and Type | Field and Description |
---|---|
protected org.springframework.jdbc.support.lob.LobHandler |
lobHandler
Lob handler for processing lob type
|
protected GlueQueryManager |
queryManager
Query Manager
|
protected GlueSequence |
sequence |
DEFAULT_BATCH_UPDATE_SIZE, DELETE, INSERT, SELECT, UPDATE
Constructor and Description |
---|
GlueJdbcDao()
»ý¼ºÀÚ(constructor).
|
Modifier and Type | Method and Description |
---|---|
int[] |
batchUpdate(String queryKey,
GlueParameter<List<?>>[] params,
int[] types)
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù.
|
int[] |
batchUpdate(String queryKey,
GlueParameter<Map<?,?>>[] params,
Map<String,Integer> types)
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù.
|
<P> int[] |
batchUpdate(String queryKey,
GlueParameter<P>[] params)
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù.
|
int[] |
batchUpdateByQueryStatement(String queryStmt,
GlueParameter<List<?>>[] params,
int[] types)
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù.
|
int[] |
batchUpdateByQueryStatement(String queryStmt,
GlueParameter<Map<?,?>>[] params,
Map<String,Integer> types)
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù.
|
<P> int[] |
batchUpdateByQueryStatement(String queryStmt,
GlueParameter<P>[] params)
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù.
|
protected org.springframework.jdbc.core.JdbcTemplate |
createJdbcTemplate(DataSource dataSource) |
int |
delete(String queryKey)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.
|
<P> int |
delete(String queryKey,
GlueParameter<P> param)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.
|
int |
deleteByQueryStatement(String queryStmt)
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.
|
<P> int |
deleteByQueryStatement(String queryStmt,
GlueParameter<P> param)
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.
|
<T> List<T> |
find(String queryKey)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
|
<T,P> List<T> |
find(String queryKey,
GlueParameter<P> param)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
|
<T,P> List<T> |
find(String queryKey,
String whereClause,
GlueParameter<P> param)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®Àå¿¡ where ÀýÀ» Àû¿ëÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
|
protected <T,P> List<T> |
findByQueryDefinitionInternal(GlueQueryDefinition def,
GlueParameter<P> param) |
<T> List<T> |
findByQueryStatement(String queryStmt)
Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
|
<T,P> List<T> |
findByQueryStatement(String queryStmt,
GlueParameter<P> param)
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
|
<P> GluePageSet |
findForNavigationPage(String queryKey,
GlueParameter<P> param,
int pageSize,
int curPage)
Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
|
GluePageSet |
findForNavigationPage(String queryKey,
int pageSize,
int curPage)
Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
|
<P> GluePageSet |
findForNavigationPageByQuery(String queryStmt,
GlueParameter<P> param,
int pageSize,
int curPage)
Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
|
GluePageSet |
findForNavigationPageByQuery(String queryStmt,
int pageSize,
int curPage)
Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
|
int |
getBatchUpdateLimit() |
GlueColumnManager |
getColumnManager()
getter method.
|
String |
getDatabaseProductName()
getter method.
|
Connection |
getDBConnection()
ConnectionÀ» Return ÇÏ´Â Method ÀÌ´Ù.
|
GlueQueryManager |
getQueryManager()
Query Manager¸¦ ¾ò´Â´Ù.
|
GlueSequence |
getSequence()
µ¥ÀÌÅͺ£À̽º Sequence °ªÀ» Çڵ鸵ÇÏ´Â GlueSequence¸¦ ȹµæÇÑ´Ù.
|
protected GlueDaoException |
handleDataAccessException(org.springframework.dao.DataAccessException dae)
JDBC Layer¿¡¼ ¹ß»ýÇÏ´Â DataAccessExceptionÀ» GlueDaoExceptionÀ¸·Î º¯È¯ ½ÃÄÑÁØ´Ù.
|
int |
insert(String queryKey)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.
|
<P> int |
insert(String queryKey,
GlueParameter<P> param)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.
|
int |
insertByQueryStatement(String queryStmt)
SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.
|
<P> int |
insertByQueryStatement(String queryStmt,
GlueParameter<P> param)
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.
|
void |
releaseDBConnection(Connection con)
getDBConnection()À» ÅëÇØ È¹µæÇÑ ConnectionÀ» ¹Ý³³ÇÏ´Â ¸Þ¼Òµå.
|
void |
setBatchUpdateLimit(int batchUpdateLimit)
setter method for DI.
|
void |
setColumnManager(GlueColumnManager columnManager)
setter method for DI.
|
void |
setFetchSize(int fetchSize)
setter method for DI.
|
void |
setLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler) |
void |
setQueryManager(GlueQueryManager queryManager)
setter method for DI.
|
void |
setSequence(GlueSequence sequence) |
void |
setTypeCast(boolean typeCast)
setter method for DI.
|
int |
update(String queryKey)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.
|
<P> int |
update(String queryKey,
GlueParameter<P> param)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.
|
int |
updateByQueryStatement(String queryStmt)
Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.
|
<P> int |
updateByQueryStatement(String queryStmt,
GlueParameter<P> param)
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.
|
getNamedParameterJdbcTemplate, initTemplateConfig
protected GlueQueryManager queryManager
protected GlueSequence sequence
protected org.springframework.jdbc.support.lob.LobHandler lobHandler
protected org.springframework.jdbc.core.JdbcTemplate createJdbcTemplate(DataSource dataSource)
createJdbcTemplate
in class org.springframework.jdbc.core.support.JdbcDaoSupport
public GlueQueryManager getQueryManager()
GlueGenericJdbcDao
getQueryManager
in interface GlueGenericJdbcDao
public void setQueryManager(GlueQueryManager queryManager)
queryManager
- Query Managerpublic void setColumnManager(GlueColumnManager columnManager)
columnManager
- public GlueColumnManager getColumnManager()
public void setTypeCast(boolean typeCast)
typeCast
- public GlueSequence getSequence()
GlueGenericJdbcDao
getSequence
in interface GlueGenericJdbcDao
public void setSequence(GlueSequence sequence)
public void setLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler)
public int getBatchUpdateLimit()
public void setBatchUpdateLimit(int batchUpdateLimit)
batchUpdateLimit
- public void setFetchSize(int fetchSize)
fetchSize
- public String getDatabaseProductName()
public Connection getDBConnection()
public void releaseDBConnection(Connection con)
con
- getDBConnection()À» ÅëÇØ È¹µæÇÑ Connectionpublic <T> List<T> find(String queryKey)
GlueGenericDao
find
in interface GlueGenericDao
queryKey
- Äõ¸® Å°public <T,P> List<T> find(String queryKey, GlueParameter<P> param)
GlueGenericDao
find
in interface GlueGenericDao
queryKey
- Äõ¸® Å°param
- ÆĶó¸ÞÅÍpublic <T,P> List<T> find(String queryKey, String whereClause, GlueParameter<P> param)
GlueGenericJdbcDao
find
in interface GlueGenericJdbcDao
queryKey
- Äõ¸® Å°whereClause
- where Àýparam
- ÆĶó¸ÞÅÍpublic <T> List<T> findByQueryStatement(String queryStmt)
GlueGenericJdbcDao
List rowset = dao.findByQueryStatement( "select * from emp" );
findByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåpublic <T,P> List<T> findByQueryStatement(String queryStmt, GlueParameter<P> param)
GlueGenericJdbcDao
List args = new ArrayList(); args.add("9999"); GlueParameter param = new GlueParameter
(args); List rowset = dao.findByQueryStatement("select * from emp where empno=?", param);
findByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåparam
- ÆĶó¸ÞÅÍpublic GluePageSet findForNavigationPage(String queryKey, int pageSize, int curPage)
GlueGenericJdbcDao
findForNavigationPage
in interface GlueGenericJdbcDao
queryKey
- Äõ¸® Å°pageSize
- ÇÑ È¸é¿¡ Display µÉ ·Î¿ì °³¼öcurPage
- ÇöÀç ÆäÀÌÁö ¹øÈ£public <P> GluePageSet findForNavigationPage(String queryKey, GlueParameter<P> param, int pageSize, int curPage)
GlueGenericJdbcDao
findForNavigationPage
in interface GlueGenericJdbcDao
queryKey
- Äõ¸® Å°param
- ¹ÙÀεù ÆĶó¸ÞÅÍpageSize
- ÇÑ È¸é¿¡ Display µÉ ·Î¿ì °³¼öcurPage
- ÇöÀç ÆäÀÌÁö ¹øÈ£public GluePageSet findForNavigationPageByQuery(String queryStmt, int pageSize, int curPage)
GlueGenericJdbcDao
GluePageSet rowset = dao.findForNavigationPageByQuery( "select * from emp", 15, 5 );
findForNavigationPageByQuery
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®ÀåpageSize
- ÇÑ È¸é¿¡ Display µÉ ·Î¿ì °³¼öcurPage
- ÇöÀç ÆäÀÌÁö ¹øÈ£public <P> GluePageSet findForNavigationPageByQuery(String queryStmt, GlueParameter<P> param, int pageSize, int curPage)
GlueGenericJdbcDao
List args = new ArrayList(); args.add("10"); GlueParameter param = new GlueParameter
(args); GluePageSet rowset = dao.findForNavigationPageByQuery("select * from emp where deptno=?", param, 15, 5);
findForNavigationPageByQuery
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåparam
- ¹ÙÀεù ÆĶó¸ÞÅÍpageSize
- ÇÑ È¸é¿¡ Display µÉ ·Î¿ì °³¼öcurPage
- ÇöÀç ÆäÀÌÁö ¹øÈ£public int update(String queryKey)
GlueGenericDao
update
in interface GlueGenericDao
queryKey
- Äõ¸® Å°public <P> int update(String queryKey, GlueParameter<P> param)
GlueGenericDao
update
in interface GlueGenericDao
queryKey
- Äõ¸® Å°param
- ÆĶó¸ÞÅÍpublic int updateByQueryStatement(String queryStmt)
GlueGenericJdbcDao
int dmlCnt = dao.updateByQueryStatement( "update emp set ename='guest' where empno=9999" );
updateByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåpublic <P> int updateByQueryStatement(String queryStmt, GlueParameter<P> param)
GlueGenericJdbcDao
List args = new ArrayList(); args.add("guest"); args.add("9999"); GlueParameter param = new GlueParameter
(args); int dmlCnt = dao.updateByQueryStatement("update emp set ename=? where empno=?", param);
updateByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåparam
- ÆĶó¸ÞÅÍpublic int insert(String queryKey)
GlueGenericDao
insert
in interface GlueGenericDao
queryKey
- Äõ¸® Å°public <P> int insert(String queryKey, GlueParameter<P> param)
GlueGenericDao
insert
in interface GlueGenericDao
queryKey
- Äõ¸® Å°param
- ÆĶó¸ÞÅÍpublic int insertByQueryStatement(String queryStmt)
GlueGenericJdbcDao
int dmlCnt = dao.insertByQueryStatement( "insert into emp(EMPNO, ENAME) values(9999,'guest')" );
insertByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåpublic <P> int insertByQueryStatement(String queryStmt, GlueParameter<P> param)
GlueGenericJdbcDao
List args = new ArrayList(); args.add("9999"); args.add("guest"); GlueParameter param = new GlueParameter
(args); int dmlCnt = dao.insertByQueryStatement("insert into emp(EMPNO, ENAME) values(?,?)", param);
insertByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåparam
- ÆĶó¸ÞÅÍpublic int delete(String queryKey)
GlueGenericDao
delete
in interface GlueGenericDao
queryKey
- Äõ¸® Å°public <P> int delete(String queryKey, GlueParameter<P> param)
GlueGenericDao
delete
in interface GlueGenericDao
queryKey
- Äõ¸® Å°param
- ÆĶó¸ÞÅÍpublic int deleteByQueryStatement(String queryStmt)
GlueGenericJdbcDao
int dmlCnt = dao.deleteByQueryStatement( "delete from emp" );
deleteByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåpublic <P> int deleteByQueryStatement(String queryStmt, GlueParameter<P> param)
GlueGenericJdbcDao
List args = new ArrayList(); args.add("10"); GlueParameter param = new GlueParameter
(args); int dmlCnt = dao.deleteByQueryStatement("delete from emp where deptno=?", param);
deleteByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåparam
- ÆĶó¸ÞÅÍprotected <T,P> List<T> findByQueryDefinitionInternal(GlueQueryDefinition def, GlueParameter<P> param)
key
- queryStmt
- param
- fetchSize
- protected GlueDaoException handleDataAccessException(org.springframework.dao.DataAccessException dae)
dae
- DataAccessExceptionpublic <P> int[] batchUpdate(String queryKey, GlueParameter<P>[] params)
GlueGenericJdbcDao
Äõ¸® Á¾·ù°¡ ¼·Î ´Ù¸£´Ù¸é °¢°¢ batchUpdate ¸Þ¼Òµå¸¦ È£ÃâÇÏ¸é µÈ´Ù. ¸®ÅϵǴ °á°ú °ªÀº sqlÀ» ½ÇÇàÇÑ °á°ú ·Î¿ì °³¼öÀÌ´Ù.final int count = 10; // batch update¸¦ À§ÇÑ GlueParameter °´Ã¼ ¹è¿ »ý¼º GlueParameter [] params = new GlueParameter
[count]; for (int i=0; i
(args); } int[] results = dao.batchUpdate("query-key", params);
batchUpdate
in interface GlueGenericJdbcDao
queryKey
- Äõ¸® Å°params
- GlueParameter Arraypublic <P> int[] batchUpdateByQueryStatement(String queryStmt, GlueParameter<P>[] params)
GlueGenericJdbcDao
final int count = 10; // batch update¸¦ À§ÇÑ GlueParameter °´Ã¼ ¹è¿ »ý¼º GlueParameter [] params = new GlueParameter
[count]; for (int i=0; i
(args); } int[] results = dao.batchUpdateByQueryStatement("update set
=? where =?", params); Äõ¸® Á¾·ù°¡ ¼·Î ´Ù¸£´Ù¸é °¢°¢ batchUpdate ¸Þ¼Òµå¸¦ È£ÃâÇÏ¸é µÈ´Ù. ¸®ÅϵǴ °á°ú °ªÀº sqlÀ» ½ÇÇàÇÑ °á°ú Row °³¼öÀÌ´Ù.
- Specified by:
batchUpdateByQueryStatement
in interfaceGlueGenericJdbcDao
- Parameters:
queryStmt
- SQL Äõ¸®¹®Àåparams
- GlueParameter Array- Returns:
- °¢°¢ÀÇ Statement°¡ ¼öÇàµÈ ÈÄ ¾÷µ¥ÀÌÆ® µÈ Row °³¼ö ¹è¿
batchUpdate
public int[] batchUpdate(String queryKey, GlueParameter<List<?>>[] params, int[] types)Description copied from interface:GlueGenericJdbcDao
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù. JDBC µå¶óÀ̹ö°¡ batch update¸¦ Áö¿øÇÏÁö ¾ÊÀ¸¸é ÀÏ¹Ý Update°¡ ½ÇÇàµÈ´Ù. »ç¿ë ¹æ¹ýÀº ¾Æ·¡ ÂüÁ¶.Äõ¸® Á¾·ù°¡ ¼·Î ´Ù¸£´Ù¸é °¢°¢ batchUpdate ¸Þ¼Òµå¸¦ È£ÃâÇÏ¸é µÈ´Ù. ¸®ÅϵǴ °á°ú °ªÀº sqlÀ» ½ÇÇàÇÑ °á°ú Row °³¼öÀÌ´Ù.int size = 10; // batch update¸¦ À§ÇÑ GlueParameter °´Ã¼ ¹è¿ »ý¼º GlueParameter >[] params = new GlueParameter[size]; for (int i=0; i
32765 Àΰæ¿ìÀÓ. params[i] = new GlueParameter >(args); } int types[] = {Types.VARCHAR, Types.TIMESTAMP, Types.BLOB, Types.BLOB, Types.BLOB, Types.CLOB} int[] results = dao.batchUpdate("query-key", params, types);
- Specified by:
batchUpdate
in interfaceGlueGenericJdbcDao
- Parameters:
queryKey
- Äõ¸® Å°params
- GlueParameter<List> Arraytypes
- java.sql.Types ÀÇ ¹è¿, dataÀÌ java.util.Date ÇüÀ̸é Types.TIMESTAMP À¸·ÎÇÏ°í, data°¡ java.io.File, byte[], java.io.InputStream ÇüÀ̸é Types.BLOBÀ¸·Î ÇÏ°í, data°¡ 32765º¸´Ù Å« StringÀ̸é Types.CLOBÀ¸·Î ÇÏ°í, ±×¿Ü´Â Types.VARCHAR·Î ÇÑ´Ù.- Returns:
- °¢°¢ÀÇ Statement°¡ ¼öÇàµÈ ÈÄ ¾÷µ¥ÀÌÆ® µÈ Row °³¼ö ¹è¿
batchUpdate
public int[] batchUpdate(String queryKey, GlueParameter<Map<?,?>>[] params, Map<String,Integer> types)Description copied from interface:GlueGenericJdbcDao
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù. JDBC µå¶óÀ̹ö°¡ batch update¸¦ Áö¿øÇÏÁö ¾ÊÀ¸¸é ÀÏ¹Ý Update°¡ ½ÇÇàµÈ´Ù. »ç¿ë ¹æ¹ýÀº ¾Æ·¡ ÂüÁ¶.Äõ¸® Á¾·ù°¡ ¼·Î ´Ù¸£´Ù¸é °¢°¢ batchUpdate ¸Þ¼Òµå¸¦ È£ÃâÇÏ¸é µÈ´Ù. ¸®ÅϵǴ °á°ú °ªÀº sqlÀ» ½ÇÇàÇÑ °á°ú Row °³¼öÀÌ´Ù.int size = 10; // batch update¸¦ À§ÇÑ GlueParameter °´Ã¼ ¹è¿ »ý¼º GlueParameter
- Specified by:
batchUpdate
in interfaceGlueGenericJdbcDao
- Parameters:
queryKey
- Äõ¸® Å°params
- GlueParameter<Map> Arraytypes
- java.sql.Types ÀÇ Map, dataÀÌ java.util.Date ÇüÀ̸é Types.TIMESTAMP À¸·ÎÇÏ°í, data°¡ java.io.File, byte[], java.io.InputStream ÇüÀ̸é Types.BLOBÀ¸·Î ÇÏ°í, data°¡ 32765º¸´Ù Å« StringÀ̸é Types.CLOBÀ¸·Î ÇÏ°í, ±×¿Ü´Â Types.VARCHAR·Î ÇÑ´Ù.- Returns:
- °¢°¢ÀÇ Statement°¡ ¼öÇàµÈ ÈÄ ¾÷µ¥ÀÌÆ® µÈ Row °³¼ö ¹è¿
batchUpdateByQueryStatement
public int[] batchUpdateByQueryStatement(String queryStmt, GlueParameter<List<?>>[] params, int[] types)Description copied from interface:GlueGenericJdbcDao
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù. JDBC µå¶óÀ̹ö°¡ batch update¸¦ Áö¿øÇÏÁö ¾ÊÀ¸¸é ÀÏ¹Ý Update°¡ ½ÇÇàµÈ´Ù. »ç¿ë ¹æ¹ýÀº ¾Æ·¡ ÂüÁ¶.int size = 10; // batch update¸¦ À§ÇÑ GlueParameter °´Ã¼ ¹è¿ »ý¼º GlueParameter >[] params = new GlueParameter[size]; for (int i=0; i
32765 Àΰæ¿ìÀÓ. params[i] = new GlueParameter >(args); } int types[] = {Types.VARCHAR, Types.TIMESTAMP, Types.BLOB, Types.BLOB, Types.BLOB, Types.CLOB} int[] results = dao.batchUpdateByQueryStatement("insert into
values (?, ?, ?, ?, ?, ?)", params, types);
Äõ¸® Á¾·ù°¡ ¼·Î ´Ù¸£´Ù¸é °¢°¢ batchUpdate ¸Þ¼Òµå¸¦ È£ÃâÇÏ¸é µÈ´Ù. ¸®ÅϵǴ °á°ú °ªÀº sqlÀ» ½ÇÇàÇÑ °á°ú Row °³¼öÀÌ´Ù.
- Specified by:
batchUpdateByQueryStatement
in interfaceGlueGenericJdbcDao
- Parameters:
queryStmt
- SQL Äõ¸®¹®Àåparams
- GlueParameter<List> Arraytypes
- java.sql.Types ÀÇ ¹è¿, dataÀÌ java.util.Date ÇüÀ̸é Types.TIMESTAMP À¸·ÎÇÏ°í, data°¡ java.io.File, byte[], java.io.InputStream ÇüÀ̸é Types.BLOBÀ¸·Î ÇÏ°í, data°¡ 32765º¸´Ù Å« StringÀ̸é Types.CLOBÀ¸·Î ÇÏ°í, ±×¿Ü´Â Types.VARCHAR·Î ÇÑ´Ù.- Returns:
- °¢°¢ÀÇ Statement°¡ ¼öÇàµÈ ÈÄ ¾÷µ¥ÀÌÆ® µÈ Row °³¼ö ¹è¿
batchUpdateByQueryStatement
public int[] batchUpdateByQueryStatement(String queryStmt, GlueParameter<Map<?,?>>[] params, Map<String,Integer> types)Description copied from interface:GlueGenericJdbcDao
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù. JDBC µå¶óÀ̹ö°¡ batch update¸¦ Áö¿øÇÏÁö ¾ÊÀ¸¸é ÀÏ¹Ý Update°¡ ½ÇÇàµÈ´Ù. »ç¿ë ¹æ¹ýÀº ¾Æ·¡ ÂüÁ¶.int size = 10; // batch update¸¦ À§ÇÑ GlueParameter °´Ã¼ ¹è¿ »ý¼º GlueParameter >[] params = new GlueParameter[size]; for (int i=0; i 32765 Àΰæ¿ìÀÓ. params[i] = new GlueParameter >(args); } Map types = new HashMap(); types.put("name0", Types.VARCHAR); types.put("name1", Types.TIMESTAMP); types.put("name2", Types.BLOB); types.put("name3", Types.BLOB); types.put("name4", Types.BLOB); types.put("name5", Types.CLOB); int[] results = dao.batchUpdateByQueryStatement("insert into values (:name0, :name1, :name2, :name3, :name4, :name5)", params, types); Äõ¸® Á¾·ù°¡ ¼·Î ´Ù¸£´Ù¸é °¢°¢ batchUpdate ¸Þ¼Òµå¸¦ È£ÃâÇÏ¸é µÈ´Ù. ¸®ÅϵǴ °á°ú °ªÀº sqlÀ» ½ÇÇàÇÑ °á°ú Row °³¼öÀÌ´Ù.
- Specified by:
batchUpdateByQueryStatement
in interfaceGlueGenericJdbcDao
- Parameters:
queryStmt
- SQL Äõ¸®¹®Àåparams
- GlueParameter<Map> Arraytypes
- java.sql.Types ÀÇ Map, dataÀÌ java.util.Date ÇüÀ̸é Types.TIMESTAMP À¸·ÎÇÏ°í, data°¡ java.io.File, byte[], java.io.InputStream ÇüÀ̸é Types.BLOBÀ¸·Î ÇÏ°í, data°¡ 32765º¸´Ù Å« StringÀ̸é Types.CLOBÀ¸·Î ÇÏ°í, ±×¿Ü´Â Types.VARCHAR·Î ÇÑ´Ù.- Returns:
- °¢°¢ÀÇ Statement°¡ ¼öÇàµÈ ÈÄ ¾÷µ¥ÀÌÆ® µÈ Row °³¼ö ¹è¿
Copyright © 2013–2019 POSCO ICT. All rights reserved.