You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br> on 2003/05/23 13:53:45 UTC

MSSQL Driver (was How to check a query)

MS SQL Server Driver from Microsoft should work fine ONLY IF you put the
SelectMethod in the url as in:

jdbc:microsoft:sqlserver://MyServer:1433;DatabaseName=MyDB;SelectMethod=curs
or

Explain: if you don't put SelectMethod=cursor, the driver will use
SelectMethod=direct and you will be restrict to only one resultset by
connection...

Other thing important is install the procedures as indicated in MS SQL
Server JDBC Driver Installation Manual (or you'll have trouble with MetaData
in java side - and probably OJB will not work).

Good luck,

Edson Richter

----- Original Message ----- 
From: "Charles Anthony" <ch...@hpdsoftware.com>
To: "'OJB Users List'" <oj...@db.apache.org>
Sent: Friday, May 23, 2003 4:57 AM
Subject: RE: How to check a query


I mean no-one's used it and said that it works without a problem !

You *may* have a problem with this driver, if your query is correct and yet
the driver is throwing an exception.

Cheers,

Charles.

>-----Original Message-----
>From: Sylvain.Thevoz@swisscom.com [mailto:Sylvain.Thevoz@swisscom.com]
>Sent: 23 May 2003 08:55
>To: ojb-user@db.apache.org
>Subject: RE: How to check a query
>
>
>>Well... no. But I'm guessing that you're using the jtds driver for SQL
>>server. I don't believe that it's supported by OJB - the
>exception you're
>>getting is a bit difficult to interpret.
>
>Yes you are right but I have no problem with this driver.
>What do you mean about "not supported"?
>
>Regards
>Sylvain
>
>-----Message d'origine-----
>De: Charles Anthony [mailto:charles.anthony@hpdsoftware.com]
>Date: vendredi, 23. mai 2003 09:51
>À: 'OJB Users List'
>Objet: RE: How to check a query
>
>
>Well... no. But I'm guessing that you're using the jtds driver for SQL
>server. I don't believe that it's supported by OJB - the
>exception you're
>getting is a bit difficult to interpret.
>
>I'm using Microsoft's own free jdbc driver (download from
>http://www.microsoft.com/sql/), and I am not having any issues with it.
>Apparently others *have* had problems, and they've recommended
>JSQLConnect
>from netDirect
>http://www.j-netdirect.com/JSQLConnect/JSQLFeatures.html
>which is not free.
>
>Cheers,
>Charles.
>
>>-----Original Message-----
>>From: Sylvain.Thevoz@swisscom.com [mailto:Sylvain.Thevoz@swisscom.com]
>>Sent: 23 May 2003 08:44
>>To: ojb-user@db.apache.org
>>Subject: RE: How to check a query
>>
>>
>>Hi again,
>>
>>>Yes, I meant "Can you do the query you want using report
>>queries instead"
>>Yes, I can.
>>
>>But this produces an error when:
>>
>>1)the query isn't correct
>>2)I check the query (ReportQueries) and an exception is thrown
>>3)I correct the query
>>4)I re-check the query and it produces this error:
>>
>>Java.sql.Exception: Internal Error. Tds 0 is already allocated.
>>  at sourceforge.jtds.jdbc.TdsConnection.allocatedTds
>>  ....
>>
>>Have you an idea what it means?
>>
>>Regards
>>Sylvain
>>
>>
>>-----Message d'origine-----
>>De: Charles Anthony [mailto:charles.anthony@hpdsoftware.com]
>>Date: vendredi, 23. mai 2003 09:31
>>À: 'OJB Users List'
>>Objet: RE: How to check a query
>>
>>
>>Hi,
>>
>>>>You might be able to do your "distinct" query using ReportQueries...
>>>Do you think about this:
>>>ReportQueryByCriteria q = QueryFactory.newReportQuery(Variable.class,
>>crit);
>>>Iterator iter = broker.getReportQueryIteratorByQuery(q);
>>>
>>
>>Yes, I meant "Can you do the query you want using report
>>queries instead" -
>>i.e. not depend upon building up a SQL statement.
>>
>>Cheers,
>>
>>Charles.
>>>-----Message d'origine-----
>>>De: Charles Anthony [mailto:charles.anthony@hpdsoftware.com]
>>>Date: vendredi, 23. mai 2003 09:15
>>>À: 'OJB Users List'
>>>Objet: RE: How to check a query
>>>
>>>
>>>Do you mean "check if the SQL is symantically correct ?"
>>>
>>>I'm afraid the answer is "no".
>>>
>>>The only way OJB could check the SQL statement would be to
>>>execute it and
>>>see if any SQL exceptions were thrown.... which wouldn't be
>>>very efficient.
>>>(Another approach would be to write a SQL parser, but really,
>>>I'd say that's
>>>overkill, and difficult to account for different database dialects).
>>>
>>>I'd only use queries base SQL statements in OJB if they were
>>>absolutely 100%
>>>necessary or significantly more efficient.
>>>
>>>You might be able to do your "distinct" query using ReportQueries...
>>>
>>>Cheers,
>>>
>>>Charles.
>>>
>>>>-----Original Message-----
>>>>From: Sylvain.Thevoz@swisscom.com
>>[mailto:Sylvain.Thevoz@swisscom.com]
>>>>Sent: 23 May 2003 08:10
>>>>To: ojb-user@db.apache.org
>>>>Subject: How to check a query
>>>>
>>>>
>>>>Hello,
>>>>
>>>>Is it a way in OJB to check the query before execute it.
>>>>For example:
>>>>
>>>>----code----
>>>>String sql ="select distinct(workstationName) from Workstation";
>>>>
>>>>Query query = QueryFactory.newQuery(Workstation.class, sql);
>>>>
>>>>boolean success = false;
>>>>
>>>>try {
>>>>  broker.beginTransaction();
>>>>  success = broker.checkQuery(query);
>>>>  broker.commitTransaction();
>>>>} catch (Throwable t) {
>>>>  broker.abortTransaction();
>>>>  t.printStackTrace();
>>>>}
>>>>----code----
>>>>
>>>>
>>>>Thanks
>>>>Sylvain
>>>>
>>>>------------------------------------------------------------
>---------
>>>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>>>
>>>
>>>
>>>This email and any attachments are strictly confidential and
>>>are intended
>>>solely for the addressee. If you are not the intended
>>>recipient you must
>>>not disclose, forward, copy or take any action in reliance on
>>>this message
>>>or its attachments. If you have received this email in error
>>>please notify
>>>the sender as soon as possible and delete it from your
>>>computer systems.
>>>Any views or opinions presented are solely those of the author
>>>and do not
>>>necessarily reflect those of HPD Software Limited or its affiliates.
>>>
>>> At present the integrity of email across the internet cannot
>>>be guaranteed
>>>and messages sent via this medium are potentially at risk.
>>>All liability
>>>is excluded to the extent permitted by law for any claims
>>>arising as a re-
>>>sult of the use of this medium to transmit information by or to
>>>HPD Software Limited or its affiliates.
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>
>>
>>This email and any attachments are strictly confidential and
>>are intended
>>solely for the addressee. If you are not the intended
>>recipient you must
>>not disclose, forward, copy or take any action in reliance on
>>this message
>>or its attachments. If you have received this email in error
>>please notify
>>the sender as soon as possible and delete it from your
>>computer systems.
>>Any views or opinions presented are solely those of the author
>>and do not
>>necessarily reflect those of HPD Software Limited or its affiliates.
>>
>> At present the integrity of email across the internet cannot
>>be guaranteed
>>and messages sent via this medium are potentially at risk.
>>All liability
>>is excluded to the extent permitted by law for any claims
>>arising as a re-
>>sult of the use of this medium to transmit information by or to
>>HPD Software Limited or its affiliates.
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>
>
>This email and any attachments are strictly confidential and
>are intended
>solely for the addressee. If you are not the intended
>recipient you must
>not disclose, forward, copy or take any action in reliance on
>this message
>or its attachments. If you have received this email in error
>please notify
>the sender as soon as possible and delete it from your
>computer systems.
>Any views or opinions presented are solely those of the author
>and do not
>necessarily reflect those of HPD Software Limited or its affiliates.
>
> At present the integrity of email across the internet cannot
>be guaranteed
>and messages sent via this medium are potentially at risk.
>All liability
>is excluded to the extent permitted by law for any claims
>arising as a re-
>sult of the use of this medium to transmit information by or to
>HPD Software Limited or its affiliates.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org
>


This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to
HPD Software Limited or its affiliates.



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.483 / Virus Database: 279 - Release Date: 19/5/2003