Hm... I moved Bind before Describe, I now have
// Construct a new portal if needed.
Portal portal = null;
if (usePortal)
{
String portalName = "C_" + (nextUniqueID++);
portal = new Portal(query, portalName);
}
sendBind(query, params, portal, noBinaryTransfer);
if (describeStatement) {
sendDescribeStatement(query, params, describeOnly);
if (describeOnly)
return;
}
still nothing
21:43:02.263 (26) simple execute,
handler=org.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandler@337ec9f7,
maxRows=0, fetchSize=0, flags=16
21:43:02.264 (26) FE=> Parse(stmt=S_1,query="SELECT $1::int",oids={0})
21:43:02.264 (26) FE=> Bind(stmt=S_1,portal=null,$1=<'2'>)
21:43:02.264 (26) FE=> Describe(statement=S_1)
21:43:02.264 (26) FE=> Execute(portal=null,limit=0)
21:43:02.265 (26) FE=> Sync
21:43:02.265 (26) <=BE ParseComplete [S_1]
21:43:02.265 (26) <=BE BindComplete [null]
21:43:02.266 (26) <=BE ParameterDescription
21:43:02.266 (26) <=BE RowDescription(1)
21:43:02.266 (26) Field(,INT4,4,T)
21:43:02.266 (26) <=BE DataRow(len=4)
21:43:02.267 (26) <=BE CommandStatus(SELECT 1)
21:43:02.267 (26) <=BE ReadyForQuery(I)
If I've understood well I should get proper result after 1st bind...?
On Thu, 25 Nov 2010 12:21:39 -0800, Maciek Sakrejda
<msakrejda@truviso.com>
wrote:
>> OTOH, it seems possible that the JDBC driver might behave differently
>> depending on whether parameter types were prespecified or not --- it
>> might issue Describe earlier in order to get the parameter types,
>> perhaps.
>
> Ah. Bingo:
>
> boolean describeStatement = describeOnly || (!oneShot &&
> paramsHasUnknown && queryHasUnknown && !query.isStatementDescribed());
>
>
> ---
> Maciek Sakrejda | System Architect | Truviso
>
> 1065 E. Hillsdale Blvd., Suite 215
> Foster City, CA 94404
> (650) 242-3500 Main
> www.truviso.com
--
----------
Radosław Smogura
http://www.softperience.eu