No subject


Mon Aug 23 13:42:47 EDT 2004


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
            //checking to see if the object is null is really only
necessary for the numbers
            int typeValue =3D getType(fieldType);
            if (typeValue <=3D 4 || typeValue =3D=3D 10) {
                switch (typeValue) {
                    case 1: entity.dangerousSetNoCheckButFast(curField,
rs.getString(ind)); break;
                    case 2: entity.dangerousSetNoCheckButFast(curField,
rs.getTimestamp(ind)); break;
                    case 3: entity.dangerousSetNoCheckButFast(curField,
rs.getTime(ind)); break;
                    case 4: entity.dangerousSetNoCheckButFast(curField,
rs.getDate(ind)); break;
                    case 10: entity.dangerousSetNoCheckButFast(curField,
rs.getObject(ind)); break;
                }
            } else {
                switch (typeValue) {
                    case 5:
                        int intValue =3D rs.getInt(ind);
                        if (rs.wasNull()) {
                            entity.dangerousSetNoCheckButFast(curField,
null);
                        } else {
                            entity.dangerousSetNoCheckButFast(curField,
new Integer(intValue));
                        }
                        break;
                    case 6:
                        long longValue =3D rs.getLong(ind);
                        if (rs.wasNull()) {
                            entity.dangerousSetNoCheckButFast(curField,
null);
                        } else {
                            entity.dangerousSetNoCheckButFast(curField,
new Long(longValue));
                        }
                        break;
                    case 7:
                        float floatValue =3D rs.getFloat(ind);
                        if (rs.wasNull()) {
                            entity.dangerousSetNoCheckButFast(curField,
null);
                        } else {
                            entity.dangerousSetNoCheckButFast(curField,
new Float(floatValue));
                        }
                        break;
                    case 8:
                        double doubleValue =3D rs.getDouble(ind);
                        if (rs.wasNull()) {
                            entity.dangerousSetNoCheckButFast(curField,
null);
                        } else {
                            entity.dangerousSetNoCheckButFast(curField,
new Double(doubleValue));
                        }
                        break;
                    case 9:
                        boolean booleanValue =3D rs.getBoolean(ind);
                        if (rs.wasNull()) {
                            entity.dangerousSetNoCheckButFast(curField,
null);
                        } else {
                            entity.dangerousSetNoCheckButFast(curField,
new Boolean(booleanValue));
                        }
                        break;
                }
            }
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D



On Thu, 2002-08-29 at 19:04, Quake_Wang wrote:
> Hi:
> 	I solved the problem , changed the SqlJdbcUtil.getValue(...) from
>=20
>       if (rs.getObject(ind) =3D=3D null) {
>           entity.set(curField.getName(), null);
>       } else {
>           switch (getType(fieldType)) {
>               case 1: entity.set(curField.getName(), =
rs.getString(ind)); break;
> 	...
>           }
>       }
>=20
> 	to:
>=20
>       try{
>           switch (getType(fieldType)) {
>               case 1: entity.set(curField.getName(), =
rs.getString(ind)); break;
> 	...
>           }           =20
>       }catch(NullPointerException npe){
>           entity.set(curField.getName(), null);
>       }
>=20
> 	Now it only read ONCE form the result set.
>=20
> David: can you add it to CVS?
>=20
> Quake
>=20
> -----????-----
> ???: Quake_Wang=20
> ????: 2002?8?29? 14:45
> ???: ofbiz-devel at lists.sourceforge.net
> ??: [OFBiz-Devel]Exception: "ResultSet can not re-read row data for =
column X" (M$ SQL)
>=20
>=20
> Hi:
> 	I'm using ofbiz 2.0 beta 2 with hsql / mysql successfully ,when =
change db to microsoft sql server 2000 (with the microsoft's jdbc =
driver) I got some exceptions like this: "ResultSet can not re-read row =
data for column X"
>=20
> 	I've found that the exception was thrown in SqlJdbcUtil.getValue.
>=20
> 	At begin , I think it maybe a bug in jdbc driver , but after read =
some posts at internet , I found it's a strange problem , Please read =
this, sun documentation:
>=20
> 	 "The ResultSet interface provides getXXX methods for retrieving =
column values from the current row. Values can be retrieved using either =
the index number of the column or the name of the column. In general, =
using the column index will be more efficient. Columns are numbered from =
1. For maximum portability, result set columns within each row should be =
read in left-to-right order, and each column should be readably once."
>=20
> 	READABLY ONCE? Did I find the reason? In SqlJdbcUtil.getValue , a =
column was read twice.
>=20
> 	Any solution ? Any idea about this?
>=20
> Regards
> Quake
>=20
>=20
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> OFBiz-Devel mailing list
> OFBiz-Devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ofbiz-devel
>=20
>=20
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> OFBiz-Devel mailing list
> OFBiz-Devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ofbiz-devel
>=20





More information about the Dev mailing list