Re: [XMLPipeDB-developer] PreparedStatement query parameters
Brought to you by:
kdahlquist,
zugzugglug
|
From: Richard B. <rbr...@gm...> - 2011-08-25 02:26:55
|
OK, spent some time digging through it with an eye to that 3rd '?'
I believe I simply need to add as many ps.setString(?,
Integer.*toString*(selected.getTaxon()));
as there are species selected.
Exports for single species work fine but if I want to export 2 species I
need the following (example is hardcoded):
ps = ConnectionManager.*getRelationalDBConnection*().prepareStatement(
basePrepareStatement.toString() );
*
for* ( SpeciesProfile selected : selectedSpeciesProfiles ) {
ps.setString(1, Integer.*toString*(selected.getTaxon()));
ps.setString(2, Integer.*toString*(selected.getTaxon()));
ps.setString(3, systemTable.getKey());
result = ps.executeQuery();
etc...
The solve is to programmatically build the ps.set... going forward.
Richard
On Tue, Aug 23, 2011 at 8:53 PM, John David N. Dionisio <do...@lm...>wrote:
> Hi Rich,
>
> Sure, I don't think it will do any harm to give the method another
> once-over. What you have to see solidly are:
>
> - What information does this method extract from the relational database?
> - What information does this method send to the Gene Database?
>
> As to the code --- no, I did not change anything. I only added comments.
> Not sure about the successful export then. What I thought was that you did
> execute the changes I described, and that is how you successfully exported
> the .gdb.
>
> John David N. Dionisio, PhD
> Associate Professor, Computer Science
> Loyola Marymount University
>
>
>
>
> On Aug 23, 2011, at 8:41 PM, Richard Brous wrote:
>
> > Yes your comments make sense but I feel as though my understanding of
> this method is the weak link... I'll work through it again tomorrow.
> >
> > Also, in thinking back over our discussions regarding
> getSystemTableManager(), I read through the code again and saw your
> comments.
> >
> > Then I realized I may have assumed you corrected the method when you may
> only in fact had commented... Was this the case?
> >
> > But then how did I get a successful two species export yesterday?
> >
> > OK, my brain is starting to hurt...
> >
> > I'm going to head to bed and start fresh tomorrow.
> >
> > Richard
> >
> > On Tue, Aug 23, 2011 at 8:18 PM, John David N. Dionisio <do...@lm...>
> wrote:
> > Hi Rich,
> >
> > The key is this message:
> >
> > org.postgresql.util.PSQLException: No value specified for parameter 3.
> >
> > That means the third question mark in the query (which turns out to be
> type = ?) was never given a value. Check that method and make sure that the
> code invokes as many set's as there are question marks in the query. And
> for this particular query, the last set is for the gene database type.
> >
> > John David N. Dionisio, PhD
> > Associate Professor, Computer Science
> > Loyola Marymount University
> >
> >
> > On Aug 23, 2011, at 7:59 PM, Richard Brous <rbr...@gm...> wrote:
> >
> >> org.postgresql.util.PSQLException: No value specified for parameter 3.
> >
> >
> ------------------------------------------------------------------------------
> > EMC VNX: the world's simplest storage, starting under $10K
> > The only unified storage solution that offers unified management
> > Up to 160% more powerful than alternatives and 25% more efficient.
> > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
> > _______________________________________________
> > xmlpipedb-developer mailing list
> > xml...@li...
> > https://lists.sourceforge.net/lists/listinfo/xmlpipedb-developer
> >
> >
>
> > <ATT00001..txt><ATT00002..txt>
>
>
>
> ------------------------------------------------------------------------------
> EMC VNX: the world's simplest storage, starting under $10K
> The only unified storage solution that offers unified management
> Up to 160% more powerful than alternatives and 25% more efficient.
> Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
> _______________________________________________
> xmlpipedb-developer mailing list
> xml...@li...
> https://lists.sourceforge.net/lists/listinfo/xmlpipedb-developer
>
>
|