Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> hopefully simple sql question
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.facIDwhere 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
![]() |
![]() |