I am currently using QueryBySQL in a few places where I have multi-table joins or otherwise complex queries. I am trying to use QueryBySQL less, because I think it is seen as a crutch, and that you should use the mappings. One down side to QueryBySQL is that your select statement is in your java code, so its best to try to centralize and externalize it somehow in case you need to make changes.
I am also running into an error in DB2 or WSAD where using QueryBySQL for the same query twice will shut down the whole server. (It happens on the stmnt.executeQuery() -- but there is no exception) no one was able to help with this issue, so my workaround is to insert a unique num into the query so it is never the same twice. (which means it is slower than if it could be reused) your select has to match your mapping for that object. -----Original Message----- From: "Balzola Gre�o, Gonzalo" [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 9:02 AM To: [EMAIL PROTECTED] Subject: Is it possible to perform my own sql-queries in OJB? Hi there: Using OJB mapping tool I've following problem: I don�t know in this example how to get the information pointer for Iterator(iter2) or Collection (col2). I saw a solution in the db.apache.org FAQ's but it not very clear for me. String sql = "SELECT A.Artikel_Nr FROM Artikel A, Kategorien PG" + " WHERE A.Kategorie_Nr = PG.Kategorie_Nr" + " AND PG.Kategorie_Nr = 2"; // get the QueryBySQL Query q2 = QueryFactory.newQuery(Article.class, sql); Iterator iter2 = broker.getIteratorByQuery(q2); // or Collection col2 = broker.getCollectionByQuery(q2); Is it possible to perform my own sql-queries in OJB? Please someone could tell me how to use or give me an example or a link where I can find further information. Thanks in advance. Sorry, but english is not my mother language. ---------------------------------------------------------------------------- --------------------------------------- Este correo electr�nico y, en su caso, cualquier fichero anexo al mismo, contiene informaci�n de car�cter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgaci�n, copia o distribuci�n a terceros sin la previa autorizaci�n escrita de Indra. En el caso de haber recibido este correo electr�nico por error, se ruega notificar inmediatamente esta circunstancia mediante reenv�o a la direcci�n electr�nica del remitente. The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
