Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JDBC Select From problem

Reply
Thread Tools

JDBC Select From problem

 
 
Finbar Saunders
Guest
Posts: n/a
 
      04-12-2004
Hi, I'm using the JDBC:ODBC bridge but am having a problem using it with MS
Access.

I want to run the following thru the bridge;
SELECT * FROM Horse WHERE horseName Like 'MINORS UNION'

I can run this query in Access with no probs. I get an SQL.Exception when
running thru the bridge.

I am assuming the problem lies with the keyword UNION being used in the
value.

any help appreciated,
Michael.


 
Reply With Quote
 
 
 
 
Alan Meyer
Guest
Posts: n/a
 
      04-12-2004
"Finbar Saunders" <(E-Mail Removed)> wrote in message
news:c5do92$2qma$(E-Mail Removed)...
> Hi, I'm using the JDBC:ODBC bridge but am having a problem using it with

MS
> Access.
>
> I want to run the following thru the bridge;
> SELECT * FROM Horse WHERE horseName Like 'MINORS UNION'
>
> I can run this query in Access with no probs. I get an SQL.Exception when
> running thru the bridge.
>
> I am assuming the problem lies with the keyword UNION being used in the
> value.


You have to check the message associated with the exception, e.g.,

try {
...
}
catch SQLException e {
system.out.println (e.getMessage());
}

It may have nothing to do with the SQL itself, but rather with
the connection, the statement, or something else.

Note, by the way, that "Like 'MINORS UNION'" is identical to
"='MINORS UNION'". Without a '%' in the like clause, there
is no reason to use "like".


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [JDBC] JDBC Driver and timezones Lew Java 0 05-19-2010 03:33 PM
How to parse the jdbc driver name from the jdbc .jar file Bruce Java 4 03-25-2006 12:01 PM
stand-alone JMS, other JDBC operations, and transactions ( ActiveMQ + JOTM + JDBC operations ) Jesus M. Salvo Jr. Java 2 02-11-2006 06:33 PM
oracle.jdbc.OracleDriver vs oracle.jdbc.driver.OracleDriver Betty Java 1 05-21-2005 05:15 PM
Re: jdbc help:sun.jdbc.odbc.JdbcOdbcDriver Keith Wansbrough Java 0 08-16-2004 07:31 PM



Advertisments