Class GlueQueryStringHelper

java.lang.Object
com.poscoict.glueframework.dao.jdbc.GlueQueryStringHelper

@Deprecated public abstract class GlueQueryStringHelper extends Object
Deprecated.
Internal Use Only. Query 문장을 다양한 포맷으로 변경해주는 유틸리티 클래스.
  • Field Details

  • Constructor Details

    • GlueQueryStringHelper

      public GlueQueryStringHelper()
      Deprecated.
  • Method Details

    • getCountQuery

      public static String getCountQuery(String query) throws GlueBadSqlGrammarException
      Deprecated.
      Argument로 주어지는 쿼리문장을 기반으로 레코드 총 개수를 얻을 수 있는 쿼리를 생성한다. 데이터베이스가 MS SQL Server인 경우에는 인라인 쿼리에 ORDER BY 절이 있으면 TOP 키워드를 사용해야 하기 때문에 다음과 같이 TOP 키워드를 항상 추가해서 카운트 쿼리를 생성한다.
       원본 쿼리: 
        "SELECT EMPNO, SAL FROM TABLE WHERE SAL > ? ORDER BY SAL"
        
       반환되는 쿼리: 
         
       1. SQL Server) 
        "SELECT COUNT(1) FROM (SELECT TOP 100 PERCENT EMPNO, SAL FROM TABLE WHERE SAL > ? ORDER BY SAL) FIND_FOR_NAVIGATION_PAGE"
       
       2. Oracle) 
        "SELECT COUNT(1) FROM (SELECT EMPNO, SAL FROM TABLE WHERE SAL > ? ORDER BY SAL) FIND_FOR_NAVIGATION_PAGE
       
       3. MySQL
        "SELECT COUNT(0) FROM (SELECT EMPNO, SAL FROM TABLE WHERE SAL > ? ORDER BY SAL) FIND_FOR_NAVIGATION_PAGE
       
      Parameters:
      query - 쿼리 문장
      Returns:
      레코드 총 개수를 얻을 수 있는 쿼리
      Throws:
      GlueBadSqlGrammarException
    • getAuditStatementForUpdate

      public static String getAuditStatementForUpdate(String query)
      Deprecated.
      Parameters:
      query -
      Returns:
      String
    • getAuditStatementForInsert

      public static String getAuditStatementForInsert(String query)
      Deprecated.
      Parameters:
      query -
      Returns:
      String
    • getAuditStatement

      public static String getAuditStatement(String query, int dmltype)
      Deprecated.
      Parameters:
      query -
      dmltype -
      Returns:
      String
    • setDatabaseProductName

      public static void setDatabaseProductName(String databaseProductName)
      Deprecated.
      DBMS에 따른 JDBC Driver 설정.
       1. Oracle
       DBMS Name: Oracle
       2. DB2
       DBMS Name: DB2/NT
       3. MSSQL
       DBMS Name: Microsoft SQL Server
       4. MySQL
       DBMS Name: MySQL
       5. Postgre
       DBMS Name: PostgreSQL
       6. SQLLite
       DBMS Name: SQLite
       
      Parameters:
      databaseProductName -
    • isMSSQLDriver

      public static boolean isMSSQLDriver()
      Deprecated.
      Returns:
      boolean
    • isOracleDriver

      public static boolean isOracleDriver()
      Deprecated.
      Returns:
      boolean
    • createQueryStmtWhereOrderByClause

      public static String createQueryStmtWhereOrderByClause(String query, String whereClause, String orderByClause)
      Deprecated.
      자바독을 자세하게 작성한다.
      Parameters:
      query -
      whereClause -
      orderByClause -
      Returns:
      String
    • getDmlType

      public static int getDmlType(String queryStmt)
      Deprecated.
      Parameters:
      queryStmt -
      Returns:
      int - 2 : update, 3 : insert, 4 : delete
    • getBindingName

      public static String getBindingName(String str)
      Deprecated.
      Internal Use only.
       Code : 
       String name = GlueQueryStringHelper.getBindingName("empno=:EmpnoP");
       System.out.println(name);
       
       Result : 
       EmpnoP
       
      Parameters:
      str -
      Returns:
      String
    • makeOrderByClause

      public static String makeOrderByClause(String str1, String str2)
      Deprecated.
      Internal Use only.
       Code : 
       String orderby = GlueQueryStringHelper.makeOrderByClause("deptno asc","empno");
       System.out.println(orderby);
       
       Result : 
       deptno asc, empno
       
      Parameters:
      str1 -
      str2 -
      Returns:
      String