Passing a variable to a SQL statement from Visual J++

Passing a variable to a SQL statement from Visual J++

Post by Jason Kella » Wed, 06 Jan 1999 04:00:00



Hi,

I have written an application in Visual J++ to connect to a remote SQL
database, using the inbuilt OBJECTPROXY command.
What I am battling to do, is to pass a variable to the SELECT
statement.

for example, this works...


but what about if I want to pass the email address as a variable which
was inputted by the user.

In SQL I would do the following...


but this does not work in Visual J++.

Can anybody help me URGENTLY !!!

Thank You
Jason Kelland

 
 
 

Passing a variable to a SQL statement from Visual J++

Post by George Rees » Wed, 06 Jan 1999 04:00:00


: Hi,

: I have written an application in Visual J++ to connect to a remote SQL
: database, using the inbuilt OBJECTPROXY command.
: What I am battling to do, is to pass a variable to the SELECT
: statement.

: for example, this works...


: but what about if I want to pass the email address as a variable which
: was inputted by the user.

: In SQL I would do the following...


: but this does not work in Visual J++.

: Can anybody help me URGENTLY !!!

Using JDBC, you should be using PreparedStatement.

--

PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie."
                            -Orson Welles

 
 
 

1. Can you pass a where with multiple statements without a variable for each where statement

Gary:


      I have been trying to write a series of stored procedures which trigger and pass each stored procedure values to complete my select statements.
  My First Stored procedure is a query definition in multiple fields.

  CREATE PROCEDURE sp_Get_alloc_param AS




  FROM Allocation_rules  



  Now I tried to create sp_get_alloc_details that issues

  CREATE PROCEDURE sp_get_alloc_details

  AS

  SELECT style, Color,  from sodetail

  --***This does not work , how can make this work .

2. Prediction Query syntax

3. Build SQL Statement in Stored Procedure by Passing Variables

4. c# code.

5. Problems passing a string variable to an SQL statement

6. Left Outer Join

7. Pass a variable as part of an SQL statement

8. can't install sql7.0 Enterprise Version on WIN2000 Server

9. Passing a variable to a sql statement

10. variable passed into a SQL statement from a shell script

11. Passing Variable to Report SQL (Visual Basic)

12. passing variables to sql statements in a Unix shell script

13. How to pass a variable into a SQL Statement Command is Data Environment