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.sta ndardError (JdbcOdbc. java:7139)
at sun.jdbc.odbc.JdbcOdbc.SQL GetDataStr ing(JdbcOd bc.java:39 08)
What is this mean?
SimpleDateFormat db_format = new SimpleDateFormat( "MM/dd/yyyy" ) ;
SimpleDateFormat user_format = new SimpleDateFormat("dd/MM/yy yy");
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.getD ate("A")) );
out.println(counter + ":"+ rs.getString("Cust_Name") + user_format.format(rs.getD ate("B")) );
java.sql.SQLException: No data found
at sun.jdbc.odbc.JdbcOdbc.sta
at sun.jdbc.odbc.JdbcOdbc.SQL
What is this mean?
SimpleDateFormat db_format = new SimpleDateFormat( "MM/dd/yyyy" ) ;
SimpleDateFormat user_format = new SimpleDateFormat("dd/MM/yy
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.getD
out.println(counter + ":"+ rs.getString("Cust_Name") + user_format.format(rs.getD
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.