Results 1 to 4 of 4
- 02-27-2009, 10:03 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 38
- Rep Power
- 0
[SOLVED] Getting the value inside a SQL Query into a String.
Hi,
Fairly simple question I guess to you guys. I have a SQL database and I want to take the value of something inside this database and place it into a string. I know the path to information inside the SQL database, I just have no idea how to get that record stored inside a string.
I have tried:
variable.getString(SQL Location);
variable.getQuery(SQL Location);
String variable = "SQL Location"; (this obviously doesnt work).
+ several other I've forgotten.
I have looked inside the JSP API and online but can't really find the solution.
thank you in advance
- 02-28-2009, 03:14 AM #2
Senior Member
- Join Date
- Dec 2008
- Location
- Hong Kong
- Posts
- 473
- Rep Power
- 5
have you specify jdbc driver in your code?
have you create a connection?
have you use preparedStatement/Statement, executeQuery
and get the resultSet?
- 02-28-2009, 11:02 AM #3
Member
- Join Date
- Feb 2009
- Posts
- 38
- Rep Power
- 0
Ok,
My jdbc driver is located inside my web.xml document on the server. The connection works fine as I am able to display on the webpage tables of information from the server.have you specify jdbc driver in your code?
have you create a connection?
have you use preparedStatement/Statement, executeQuery
and get the resultSet?
What I am trying to do is this (only part of my code):
Basically, I am trying to compare a password inputted from the user with a password inside the sql database, if they are the same, do something.Java Code:<sql:query var="sqlPass" sql="SQL LOCATION" /> (Sql Location contains a real sql query.) <% String password = request.getParameter("passWord"); if (password.equals(sqlPass)) { %> ++ More code
- 03-01-2009, 10:08 AM #4
Member
- Join Date
- Feb 2009
- Posts
- 38
- Rep Power
- 0
Similar Threads
-
Java Popup Window & Url Query String Value
By Rivelyn in forum New To JavaReplies: 4Last Post: 01-20-2011, 05:03 AM -
Help!! how to turn query result to string
By stefanybaez in forum Advanced JavaReplies: 2Last Post: 12-11-2008, 11:42 AM -
How to pass mysql string through a url parameter to a detail page query
By kwesiaryee in forum New To JavaReplies: 1Last Post: 08-22-2008, 06:28 PM -
[SOLVED] General string problem in my database query.....?
By prabhurangan in forum New To JavaReplies: 7Last Post: 06-25-2008, 08:55 AM -
string inside of a xml
By Heather in forum XMLReplies: 2Last Post: 03-28-2008, 05:21 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks