Re: [Oracle] How to check for empty ResultSet?

From: Kevin C. (nomail_at_fake.com)
Date: 03/14/04


Date: Sun, 14 Mar 2004 00:11:20 GMT


"Igor N. Kolomiyets" <list@inksystems.net> wrote in message
news:c2vftc$hg7$1@kermit.esat.net...
> Result Set will return false if there is no records in it. If it throws
> such an exception it is something wrong with the way the result set was
> opened.
> What driver do you use? Can you provide your code from the point where
> you are creating the statement used top open the ResultSet?

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection con = DriverManager.getConnection("jdbc:oracle:oci8:@mydb",
"scott", "tiger");
try
{
    Statement statement = con.createStatement(ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_UPDATABLE);
    String query; // query string built elsewhere
    ResultSet rs = statement.executeQuery(query);
    while (rs.next()) // breaks to exception handler if rs is empty
    { ... }
}
catch (SQLException e)
{ System.out.println(e.getMessage()); }



Relevant Pages

  • Re: Stored Procedure error is not catched
    ... If the procedure does some queries before the failing update, what does the jTDS driver do? ... failed but in my java code the SQLException is not thrown. ... tell me how to fix this bug? ... you do get your expected exception. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: windows error codes
    ... Driver Development Tools: Windows DDK ... This indicates that a kernel-mode program generated an exception which the error handler did not catch. ... For a complete list of exception codes, see the ntstatus.h file located in the inc directory of the Windows DDK. ... This article describes how to troubleshoot a "STOP 0x0000001E KMODE_EXCEPTION_NOT_HANDLED" error message. ...
    (microsoft.public.windowsxp.general)
  • RE: getting Kmode Exception Not Handled error
    ... The address at which the exception occurred 0xf7163ab0 ... Faulty device driver or system service. ... Disabling memory caching of the BIOS might also resolve the error. ...
    (microsoft.public.win2000.setup)
  • Re: BSOD
    ... This indicates that a kernel-mode program generated an exception which the ... the inc directory of the Windows Driver Kit. ... Make sure you have enough disk space. ... with your hardware vendor for any BIOS updates. ...
    (microsoft.public.windows.server.general)
  • Re: x64 XP BSOD on USB device reset or D3 entry
    ... Have you tried running the test with driver verifier with special pool ... I did not assign any cleanup routine to any KMDF object. ... The completion routine only deletes objects that were allocated to ... The exception code that was not handled ...
    (microsoft.public.development.device.drivers)