1 5 package com.teamkonzept.lib; 6 7 import java.sql.*; 8 9 15 public class TKDBResultInfo { 16 17 public String colNames[] = null; 18 public int colTypes[] = null; 19 public int colCount = 0; 20 21 27 public TKDBResultInfo( ResultSet rs ) { 28 extractResultSetInfos( rs ); 30 } 31 32 41 public void extractResultSetInfos( ResultSet rs ) { 42 try { 43 ResultSetMetaData rsmd = rs.getMetaData(); 44 colCount = rsmd.getColumnCount(); 45 46 if( colCount <= 0 ) return; 47 colNames = new String [ colCount ]; 48 colTypes = new int[ colCount ]; 49 for( int i=1; i<=colCount; i++ ){ 50 colNames[i-1] = rsmd.getColumnLabel(i).toUpperCase(); 51 colTypes[i-1] = rsmd.getColumnType(i); 52 } 53 } 54 catch (SQLException ex) { 55 TKDBLogger.logSQLException( ex ); 56 } 57 } 58 } 59 60 | Popular Tags |