Re: Java Client RawRows Query
Re: Java Client RawRows Query
- Subject: Re: Java Client RawRows Query
- From: Florijan Stamenkovic <email@hidden>
- Date: Sun, 27 Apr 2008 20:15:04 -0400
Neil,
EOUtilities is a part of EOAccess, which is not a part of the client
libraries. If you managed to get it in your client side code you must
be including the server side only libraries into your client
application. You are not allowed to distribute these with your client
application! I do mention this in the tutorial, please check out:
http://web.mac.com/flor385/eSwamp/software/
wojc_tutorial.html#client_libs
To solve your problem I would use stateless RMI to access a server
side method that does the EOUtilities call... If you need help with
this I can explain how off list...
Also I'd like to notify you that I have in the beginning of this
month updated the tutorial, nothing significant, but it now points to
JBND for more info on how to bind a Swing GUI (which I assume you are
doing) to EOF. If you are not familiar with JBND, it is a library I
made specially for this purpose, and it can be found at:
http://web.mac.com/flor385/JBND/
And finally, welcome to the WOJC club (I assume you are new to it
since I don't recall seeing your name before, and I do try to keep
track of JC users out there), and do not hesitate to ask if you need
any help...
Best regards,
Flor
On Apr 27, 2008, at 17:00, Neil MacLennan wrote:
I'm running a JavaClient application (and surprised how easy it is
to connect to my EOModel on the server :-) Thanks to Florijan's
walkthrough [http://web.mac.com/flor385/eSwamp/software/
wojc_tutorial.html]).
I'm trying to run a simple SQL query that performs a SQL sum on a
table, and I thought of using EOUtilities.rawRowsForSQL to do this
read operation rather than return a full set of EOs and sum them in
code. However I got this error:
[AWT-EventQueue-0] DEBUG uk.org.cwwresources.TicketSearch - An
error occurred: modelGroup: an EOEditingContext's root object store
must be an EOObjectStoreCoordinator for this method to function.
java.lang.IllegalArgumentException: modelGroup: an
EOEditingContext's root object store must be an
EOObjectStoreCoordinator for this method to function.
at com.webobjects.eoaccess.EOUtilities.modelGroup(EOUtilities.java:
1004)
at com.webobjects.eoaccess.EOUtilities.databaseContextForModelNamed
(EOUtilities.java:766)
at com.webobjects.eoaccess.EOUtilities.rawRowsForSQL
(EOUtilities.java:547)
at uk.org.cwwresources.TicketSearch.fetchCountTallies
(TicketSearch.java:125)
at uk.org.cwwresources.ScanIt$1.actionPerformed(ScanIt.java:80)
at javax.swing.Timer.fireActionPerformed(Timer.java:271)
at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
The calling code was:
EOEditingContext ec = new EOEditingContext();
String sql = "SELECT sum(*) AS overallTotal FROM tickets";
NSArray result1 = EOUtilities.rawRowsForSQL(ec,"Shop", sql, null);
I know that my JC<->Server link is working as I can retrieve EOs
fine in another method in the same class.
What I don't know is (i) whether or not this is
"fixable"/"possible" and if it is I don't have enough knowledge to
fix it; and (ii) is there an alternative way to access something
like "SELECT sum(*) AS overallTotal FROM tickets" using JavaClient
and EOs or otherwise.
Thanks in advance for any pointers...
.neilmac
PS OSX10.5/WO5.3/MySQL5/Eclipse/WOLips/No_Wonder (but have it
installed -- can I use it with JavaClient?)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden