Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2003-11-27
1
Medium Priority
?
1,039 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 35

Accepted Solution

by:
TimYates earned 1000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Read on to get a few ideas on how to promote your next corporate event.
The online market is growing at an unprecedented rate and retail eCommerce sales are expected to reach $4 trillion by 2020. Yet, the profit is not just there for the taking because you have to set yourself apart from the competition.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

688 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