Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to access elements of included jsp  from parent jsp's save button 9 30
grep code 4 217
maven j2ee examles 2 64
junit initializtion error 2 22
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 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