Solved

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

Posted on 2003-11-27
1
1,033 Views
Last Modified: 2009-07-29
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")) );

0
Comment
Question by:alorsetar2000
1 Comment
 
LVL 35

Accepted Solution

by:
TimYates earned 250 total points
ID: 9830917
do you loop round your resultset?

while( rs.next() )
{
  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")) );
}

sounds like you are getting no results...
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question