[OJB-developers] JDBCAccess performance optimization
Brought to you by:
thma
From: Jakob B. <jbr...@ho...> - 2002-03-05 17:51:21
|
hi, the performance optimization in JDBCAccess crashes or at least slows down QueryBySQL: sql = "select * from tabPerson where name like '%er'"; query = new QueryBySQL(Person.class, sql); in the above sample the sequence of the columns may not match the sequence of the fields in the ClassDescriptor, that's why i got the column id from the resultset using findColumn(). static Object getObjectFromColumn(ResultSet rs, FieldDescriptor fld) throws SQLException { int jdbcType = fld.getColumnJdbcType(); int columnId = fld.getColNo(); //rs.findColumn(fld.getColumnName()); //use columnId from rs BRJ return getObjectFromColumn(rs, jdbcType, columnId); } i do not know how much this lookup affects performance. but for QueryBySQL it has a negative effect because the SqlBaseIterator may get an exception in the method getObjectFromResultSet() and therefore try to retrieve the object via getObjectByIdentity(). jakob |