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

Reply via email to