Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> hopefully simple sql question

hopefully simple sql question

From: Alexander Brown <browna1_at_cs.man.ac.uk>
Date: Thu, 8 May 2003 11:01:13 +0000 (UTC)
Message-ID: <b9dddp$k17$1@titan.btinternet.com>


Hi Everyone,

I am developing a simple Java application which accesses an oracle database through JDBC. Ive got the connection working fine, but was wondering about the best way of performing a particular query as a preparedStatement. Its easy to see how to do it as a dynamically created statement, but prepared is throwing some problems. Basically for a university project I am accessing a holidays database, in which every hotel is in a many:many relationship with a table of facilitis. I want to be able search for a hotel and have it returned ONLY if it has a swimming pool, or if it has any facilities. I can easily do the search on has pool or doesnt have pool using the line

                         WHERE 1 IN facInHotel.facID
where 1 is the id of swimming pool in the faciliteies table. (facInHotel is the realionship between hotels and facilities). Can anyone suggest a simple way to do this, or will i have to go down the avenue of using normal statements instead of prepared. I hope this all makes sense, thanks for your time

Alex Received on Thu May 08 2003 - 06:01:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US