Solved

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

Posted on 2003-11-27
1
1,027 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A safe way to clean winsxs folder from your windows server 2008 R2 editions
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now