|
Firstly, let me show my code snippet:
--------------------------------------------------------------------------------------------------
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = DriverManager.getConnection("jdbc:odbc:msoracle", "vahps", "manager"); stmt = con.createStatement(); PreparedStatement pstmt = con.prepareStatement("SELECT systemid FROM user_pass WHERE username = ? AND password = ?"); synchronized (pstmt) { pstmt.clearParameters(); pstmt.setString(1, name); pstmt.setString(2, passwd); rs = pstmt.executeQuery(); while (rs.next()) { testvalue = rs.getString("systemid"); out.println
("System ID: " + testvalue +
"<BR>");
} } } catch (ClassNotFoundException e) { out.println ("Cannot connect to db<BR>"); out.println (e.getMessage() + "<BR>"); } catch (SQLException e) { out.println ("SQLException caught: " + e.getMessage()); } --------------------------------------------------------------------------------------------------------------
The line in bold should
display the variable 'testvalue', even if it's just one row of
data returned. And, as you may have guessed it's not working........ Can anyone
tell me what I can do to fix this. I am connecting to an Oracle DB using the
jdbc-odbc driver from Microsuck. Which I think is the culprit....... What do you
think?
Antonio
|
- Re: ResultSet not giving up data Antonio Villafana
- Re: ResultSet not giving up data Andras Balogh
- Re: ResultSet not giving up data Chris Pratt
- Re: ResultSet not giving up data John Overland
- Re: ResultSet not giving up data David Cole
