db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dyre.Tjeldv...@Sun.COM
Subject Re: sql query input prompts
Date Mon, 07 Jan 2008 13:29:55 GMT
MR GS REARDON <gsreardon@verizon.net> writes:

> Hello:
>    
>   I'm looking for documentation and examples on user input prompts in
>   a sql query. 

Not sure I grok what you're saying here? Do you want to write SQL which
reads input from a terminal, or window?

The conventional way of doing this (with JDBC) is read your input in
Java and then use it to set parameters in a PreparedStatement (or
construct a statement if that's more appropriate). E.g. something like

PreparedStatememt ps = conn.prepareStatement("SELECT * FROM T where i =
?");

int i = readInput();

ps.setInt(1,i);

ps.executeQuery();

...


>I'd appreciate someone telling me where I can find this
>   information.

Google for Java and JDBC tutorials.

-- 
dt

Mime
View raw message