Result set not returning values
hi all,
i have a paculiar prob in my code..
i have a method that has the DB connection param.. connects to the DB.. retrieves data and sends it across..
All connection parameters are correct
Data is available in the table
Data is retrieved when the statement is run on DB client pl sql editor.
but rs.next() returns false
what could be the issue ???
below is the code..
public void getEventKeys() {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
// This is format for below string
// jdbc:oracle:thin:@//host:port/service
String url = "jdbc:oracle:thin:@//cola094-vip:1521/XRDEV";
// username: scott
// password: tiger
Connection conn = DriverManager.getConnection(url,"scott", "tiger");
conn.setAutoCommit(true);
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select my_key from my_trigger");
while (rset.next()) {
System.out.println ("There is data!");
}
stmt.close();
}
catch (Exception e) {
System.out.println (e.getMessage());
}