Re: AW: svc-query-jdbc queryresult
Gene McCullough <[email protected]> Fri, 23 Sep 2005 10:15:05 -0500
| Newsgroups | gmane.comp.java.keel.devel |
|---|---|
| Message-ID | <[email protected]> |
How i typically used it:
query defined as
<query-sql id="ListCaseMasterFilingsByDate" logger="occa" >
<dbpool>oscn-dbpool</dbpool>
<dbtype>oscn-dbtype</dbtype>
<criteria name="caseMasterId" descrip="fk for casemaster table"/>
<result name="id" descrip="Key for occa_filing table" />
<result name="action_id" descrip="" />
<result name="status_id" descrip="" />
<result name="filing_type_id" descrip="" />
<result name="DateFiled" descrip="" />
<result name="ScreenMsg" descrip="" />
<result name="dockettext" descrip="" />
<sql><![CDATA[
SELECT o.id , o.action_id, o.status_id, o.filing_type_id, d.DateFiled,
c.ScreenMsg, d.dockettext FROM occa_filing o left JOIN docket d
ON d.DocketID = o.docket_id left join codes c on d.LineCodeID = c.CodesID
WHERE o.casemaster_id = $caseMasterId
order by d.DateFiled]]>
</sql>
</query-sql>
code...
List filings = null;
Query myDefaultQuery = (Query) req.getService(Query.ROLE,
"ListCaseMasterFilingsByDate");
myDefaultQuery.setCriteria("caseMasterId", caseMasterID);
filings = myDefaultQuery.getQueryResults();
...
Iterator i = filings.iterator();
Map oneRSRecord = null;
while (i.hasNext()) {
currentRecordNumber++;
oneRSRecord = (Map) i.next();
try {
Id = String.valueOf(oneRSRecord.get("id"));
log.debug( "id is => " + Id);
actionstr = SuperString.notNull( (String)
oneRSRecord.get("action_id") );
statusstr = SuperString.notNull( (String)
oneRSRecord.get("status_id") );
}catch(Exception e){
log.fatalError("Now what???" + e.getMessage());
}
}
which produces in log
Now what???java.lang.Long
This code worked without fail previously without the try catch block, i
added that after the updates to keep the model from bombing completely.
Any help appreciated, because I use the svc throughout the project.
thanks,
gene
Vidakovic, Aleksandar wrote:
> Salut Gene,
>
> I'm using svc-query-jdbc quite extensively... and if there are problems it's me who produced them, because I committed some changes some time ago. Send me more of your code (or at least the query) so that I can see if I can fix this. Running the unit tests didn't cause any problems. I'll look into it tonight or tomorrow...
>
> Cheers,
>
> Aleks
>
> -----Ursprüngliche Nachricht-----
> Von: Gene McCullough [mailto:[email protected]]
> Gesendet: Freitag, 23. September 2005 00:59
> An: Keel Developers List
> Betreff: [Keelgroup] svc-query-jdbc queryresult
>
>
> Anybody else using svc-query-jdbc? After updating the module, I get
> cast exceptions trying to get data from the QueryResult (a List of Map
> objects).
>
> Before the last code change to the project I was able to get all data like:
>
> code = SuperString.notNull( (String) oneRSRecord.get("ScreenMsg") );
>
> where oneRSRecord is a nested Map from the List. Now seems the "fields"
> are typed in a manner that doesn't convert to a String.
>
> I may have migrated to java 1.5 in there also (I was pulled from dev for
> several months). Seems like there were lots of changes to DefaultQuery,
> am I the only person having this problem. Any suggestions, besides
> changing all instances to expect a certain data type?
>
> TIA,
> gene
> http://keelframework.org/documentation.shtml
> Keelgroup mailing list
> [email protected]
> http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com
> http://keelframework.org/documentation.shtml
> Keelgroup mailing list
> [email protected]
> http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com
>
http://keelframework.org/documentation.shtml
Keelgroup mailing list
[email protected]
http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com