Link to home
Start Free TrialLog in
Avatar of alorsetar2000
alorsetar2000

asked on

java.sql.SQLExcpetion: No data found...

this is the first time i saw this error,
java.sql.SQLException: No data found
        at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7139)
        at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3908)
   
What is this mean?
SimpleDateFormat db_format = new SimpleDateFormat( "MM/dd/yyyy" ) ;
SimpleDateFormat user_format = new SimpleDateFormat("dd/MM/yyyy");

This is my code:
 PreparedStatement ps = conn.prepareStatement( "SELECT * FROM ACB WHERE " +
    "    (A > ? AND A < ?)  "+
    " OR (B > ? AND B < ? ) " ) ;
    ps.setDate( 1, new java.sql.Date( db_format.parse( dateA ).getTime() ) );
    ps.setDate( 2, new java.sql.Date( db_format.parse( dateB ).getTime() ) );
    ps.setDate( 3, new java.sql.Date( db_format.parse( dateA ).getTime() ) );
    ps.setDate( 4, new java.sql.Date( db_format.parse( dateB ).getTime() ) );
.
.
.
out.println(counter + ":"+ rs.getString("Cust_Name") + user_format.format(rs.getDate("A")) );
out.println(counter + ":"+ rs.getString("Cust_Name") + user_format.format(rs.getDate("B")) );

ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial