Hi folks,
I was trying to use prepared statements in my application. My selects consist of joins over several tables and I thought this would help performance.
Instead, I got a DataSetException which I could track down in the latest Village code. It says "This schema represents several tables."
From a deeper look into the code I saw that this one could never work. Reason: When the QueryDataSet(ResultSet) constructor is used, selectString is null and fetchRecords() tries to create one for no apparent reason:
---8<---
if (selectString == null)
{
selectString = new StringBuffer (256);
selectString.append ("SELECT ");
selectString.append (schema().attributes());
selectString.append (" FROM ");
selectString.append (schema().tableName());
}
---8<---In this piece of needless code schema().tableName() is called which throws the abovementioned exception if more than one table is referenced in the ResultSet. So this stuff cannot work for selects including joins.
Call for comments: - Can this be verified by anyone else? - Is fixing Village a good option? - Does anyone know a workaround which we can put into BasePeer?
Bye, Thomas.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
