You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Rob Tomlin <ro...@mekon.com> on 2003/06/23 13:35:22 UTC

Code fix for JDBCDescriptorsStore

Hi,

I have been trying to use the JDBCDescriptor store and 
SQL Server 2000 along with:

Microsoft SQL Server 2000 Driver for JDBC 
(Service Pack 1) Version 2.2.0029

During the domain initialisation the following exception
SQLException is thrown @ line 1597:

"ResultSet can not re-read row data for column 4"

The cause is an attempt to read the result columns
out of order i.e. PROPERTY_NAMESPACE is column 5,
PROPERTY_VALUE is column 4.

To fix replace the body of the while loop with:

String propertyName = res.getString(PROPERTY_NAME);
String propertyValue = res.getString(PROPERTY_VALUE);
String propertyNamespace = res.getString(PROPERTY_NAMESPACE);
String propertyType = res.getString(PROPERTY_TYPE);
boolean propertyProtected = (res.getInt(PROPERTY_PROTECTED) == 1);
NodeProperty property = 
	new NodeProperty(propertyName, 
      	propertyValue, 
            propertyNamespace, 
            propertyType, 
            propertyProtected);
properties.put(propertyNamespace + propertyName, property);

I have attatched the patched file.

Cheers

Rob Tomlin

Re: Code fix for JDBCDescriptorsStore

Posted by Sylwester Lachiewicz <la...@plusnet.pl>.
Hi,
i look into code and found that there is many places where prepared statment
is created with "select * from .."
I suggest to replace this with fetch only required fields or return value
"1" where we check for resource exist.
Also there lots of TODO items.
Is there anyone interested with fix?

Regards,
Sylwester
----- Original Message ----- 
From: "Rob Tomlin" <ro...@mekon.com>
To: "MAIL_Slide Developer List (E-mail)" <sl...@jakarta.apache.org>
Sent: Monday, June 23, 2003 1:35 PM
Subject: Code fix for JDBCDescriptorsStore


Hi,

I have been trying to use the JDBCDescriptor store and
SQL Server 2000 along with:

Microsoft SQL Server 2000 Driver for JDBC
(Service Pack 1) Version 2.2.0029

During the domain initialisation the following exception
SQLException is thrown @ line 1597:

"ResultSet can not re-read row data for column 4"

The cause is an attempt to read the result columns
out of order i.e. PROPERTY_NAMESPACE is column 5,
PROPERTY_VALUE is column 4.

To fix replace the body of the while loop with:

String propertyName = res.getString(PROPERTY_NAME);
String propertyValue = res.getString(PROPERTY_VALUE);
String propertyNamespace = res.getString(PROPERTY_NAMESPACE);
String propertyType = res.getString(PROPERTY_TYPE);
boolean propertyProtected = (res.getInt(PROPERTY_PROTECTED) == 1);
NodeProperty property =
new NodeProperty(propertyName,
      propertyValue,
            propertyNamespace,
            propertyType,
            propertyProtected);
properties.put(propertyNamespace + propertyName, property);

I have attatched the patched file.

Cheers

Rob Tomlin



---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org