db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject [Fwd: Re: How to run the Apache DB Torque tutorial with Derby]
Date Sat, 08 Oct 2005 09:31:13 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
I took a quick look at this bug. It seems to me Derby Client is
behaving as expected rather than the embedded driver though it doesn't
seem like it. The query in question gets a ResultSet and its metadata
ResultSet rs = s.executeQuery("SELECT id, name FROM
ResultSetMetaData metaData = rs.getMetaData();<br>
if (metaData.isReadOnly(1))<br>
System.out.println("ID column is readonly");<br>
Since a FOR UPDATE clause is not specified, the resultset that is
returned is <b>readonly</b>, which is what Derby client returns for
metaData.isReadOnly(1). Once a FOR UPDATE clause is added, Derby client
doesn't report the column as readonly.<br>
The problem is really with the embedded driver... Even when FOR UPDATE
clause is not specified, current implementation of isReadOnly() still
returns FALSE, when returning TRUE seems more correct.<br>
&nbsp;&nbsp;&nbsp; public boolean isReadOnly(int column) throws SQLException {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; validColumnNumber(column);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // we just don't know if it
is a base table column or not<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return false;<br>
&nbsp;&nbsp;&nbsp; }<br>

View raw message