M
Mike
I am playing around learning JSP, connecting it to my testing
(non-production) MS-SQL database.
In my java code I have a string variable tran_no
Is there a way to pass this off to my SQL code where clause?
ResultSet rs = sel.executeQuery("select * from sample_table where
trans_num=tran_no");
I know that this is not correct code. Just trying to get across what I
want to do.
I can accomplish this is my code, by returning all records in the
table, using an if statement to re-assign the results to new variables
and then only returning these new variables to the screen. This
however seems to be the long way to go about it if I could just pass
the variable as a parameter to the SQL statement in the first place.
Thanks in advance.
(non-production) MS-SQL database.
In my java code I have a string variable tran_no
Is there a way to pass this off to my SQL code where clause?
ResultSet rs = sel.executeQuery("select * from sample_table where
trans_num=tran_no");
I know that this is not correct code. Just trying to get across what I
want to do.
I can accomplish this is my code, by returning all records in the
table, using an if statement to re-assign the results to new variables
and then only returning these new variables to the screen. This
however seems to be the long way to go about it if I could just pass
the variable as a parameter to the SQL statement in the first place.
Thanks in advance.