Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners SQLException caught: No data found

Have Programming Question? Ask it here!
 
 
 


ajay2124lv
SQLException caught: No data found
0 Answer(s)      2 years and 5 months ago
Posted in : Java Beginners


i m using ms office 2010, n when i run my source code it is giving error SQLException caught:No data found, plz help me why i am getting this exception, thanks alot, my source code is as :

import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.awt.print.*; import sun.audio.*; import java.io.*; import java.sql.*; class loginevati extends JFrame implements ActionListener { JLabel l,l1,l2; JTextField t,t1; JPasswordField p; JButton b,b1; JPanel p1,p2,p3,p4,p5,p6,p7; Container c; Color c1=new Color(128,128,128); private Image img;

loginevati()
{
  c=getContentPane();
  //setLayout(new FlowLayout(FlowLayout.CENTER));

  l=new JLabel("              EVATI");
  l.setFont(new Font("TimesNewRoman",Font.BOLD,30));
  l.setForeground(Color.black);

  ImageIcon i=new ImageIcon("natureevati.jpg");
  img=i.getImage();
  //JLabel li=new JLabel(i);

  t=new JTextField("  English Voice And Accent Training Institute");
  t.setFont(new Font("TimesnewRoman",Font.BOLD,15));
  t.setForeground(Color.white);
  t.setBackground(Color.green);
  t.setEditable(false);
  t.setPreferredSize(new Dimension(330,10));

  l1=new JLabel("User Name");
  l2=new JLabel("Password  ");

  l1.setForeground(Color.blue);
  l2.setForeground(Color.blue);

  b=new JButton("Login");
  b.setForeground(Color.blue);

  b1=new JButton("Change Password");
  b1.setForeground(Color.blue);

  t1=new JTextField(10);
  p=new JPasswordField(10);
  t1.setForeground(c1);
  p.setForeground(c1);

  p1=new JPanel();
  p1.add(l);
  p1.add(t);
  p1.setLayout(new GridLayout(2,1));
  p1.setBackground(c1);

  p7=new JPanel();
  p7.add(p1);
  p7.setLayout(new FlowLayout(FlowLayout.CENTER));

  p2=new JPanel();
  p2.add(l1);
  p2.add(t1);
  p2.setLayout(new FlowLayout(FlowLayout.CENTER));

  p3=new JPanel();
  p3.add(l2);
  p3.add(p);
  p3.setLayout(new FlowLayout(FlowLayout.CENTER));



  p4=new JPanel();
  p4.add(b);
  p4.add(b1);
  p4.setLayout(new FlowLayout(FlowLayout.CENTER));

  p5=new JPanel();
  p5.add(p2);
  p5.add(p3);
  p5.add(p4);
  p5.setLayout(new GridLayout(3,1));

  p6=new JPanel();
  p6.add(p7);
  p6.add(p5);
  p6.setLayout(new GridLayout(2,1));



  c.add(p6);
  c.setLayout(new FlowLayout(FlowLayout.CENTER));
  //c.setBackground(img);

  b.addActionListener(this);


}

public void actionPerformed(ActionEvent e)
{
  if(e.getSource()==b)
  {
     String s=t1.getText();
     String ss=p.getText();
     System.out.println(s);
     System.out.println(ss);
     try
     {
       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       Connection con=DriverManager.getConnection("jdbc:odbc:evati1");
       Statement st=con.createStatement(); System.out.println("u got is  ajay the great");
       ResultSet rs=st.executeQuery("select * from login where username='"+s+"' and password='"+ss+"'");

       String uname="",pass="";
       while(rs.next())
       {
         uname=rs.getString("username");
         pass=rs.getString("password");
       }
        if(s.equals(uname) && ss.equals(pass))
        {

        }

     }
      catch(ClassNotFoundException ee)
{
  System.out.println("eer");
}
 catch(SQLException eee)
{
  System.out.println("SQLException caught:"+ eee.getMessage());

}
  }
}
public static void main(String args[])
{
  JFrame k=new loginevati();
  k.setTitle("LOGIN");
  k.setSize(500,500);
  k.setVisible(true);
  k.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
}

}


Advertisement
View Answers

Related Tutorials/Questions & Answers:
SQLException caught: No data found
SQLException caught: No data found  i m using ms office 2010, n when i run my source code it is giving error SQLException caught:No data found, plz...) { System.out.println("eer"); } catch(SQLException eee) { System.out.println
SQLException:Column not found? (help me:(
SQLException:Column not found? (help me:(  import javax.swing.... extends JFrame implements ActionListener { String userid="data",password="1234...() { super("Store Data"); setSize(300,400
Advertisements
ODBC driver manager return 'Data source name not found.
ODBC driver manager return 'Data source name not found.  Why does the ODBC driver manager return 'Data source name not found and no default driver specified Vendor: 0
JDBC Class Not Found Exception
; } JDBC ClassNotFoundException And SQLException ClassNotFoundException...());     } If the database driver class not found then it throws ClassNotFoundException. The catch block must handle this class not found exception
Path was not found
Path was not found  The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
identifier not found
identifier not found  Getting compilation error " identifier not found " please explain ?   identifier means variable name,,,,make sure it same as declaration
File not found
not found
File not found
not found
File not found
"(specified file not found
File not found
"(specified file not found
File not found
getting an error "emp_code.doc"(specified file not found)  Hi Friend
Steps not found.
Steps not found.  import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; public class Details1 extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse
File not found
not found)  Hi Friend, Visit Here Thanks
mycustomer.hbm.xml not found
(); org.hibernate.Session s=sf.openSession(); Transaction t=s.beginTransaction(); //Query q...="p1.mycustomer" table="fedback_data"> <composite-id name="name" type...;/property> <property name="quality"> <column name="Q"/> <
mycustomer.hbm.xml not found
(); //Query q=s.createQuery("from mycustomer"); //q.setCacheable(true); //l... name="p1.mycustomer" table="fedback_data"> <composite-id name="name" type...; </property> <property name="quality"> <column name="Q"/>
class not found exception
class not found exception  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterprint("code sample
javascript image not found
javascript image not found  javascript if image not found   <a href='$image'> <img alt='No Image' src='$image' onError="this.parentNode.onclick=function() {return(false);}"> </a>
javax.servlet not found error
javax.servlet not found error  why iam getting javax.servlet error while running my servlet program...after setting the classpath also i am finding that problem
no def found - JSP-Servlet
no def found  i have used the code of file upload from rose india but when i run no def found for fileupload exception although i have put jar file in lib folder code i get from D:\project\Uploading Employee Profile
CLASS NOT FOUND EXCEPTION
CLASS NOT FOUND EXCEPTION   I AM USING INTERNET EXPLORER VERSION 6.00... NOT FOUND EXCEPTION AND THE BOX IS DISPLAYED AND I CLICK ON DETAILS BUTTON...: trigger logging q: hide console r: reload policy configuration s
class not found error - JDBC
class not found error  thanks for your response. please clarify the following doubts. i am having the specified mysql connector jar file. where that jar file has to be placed. also does the jdbc driver need to be installed
Error:No Class Found Exception:org.postgresql.driver
Error:No Class Found Exception:org.postgresql.driver  Error:No Class Found Exception:org.postgresql.driver while connecting JDBC With PostgreSQL 8.4 I m running My Program with java 6.0
unable to import class com.opensymphony.xwork2.ActionContext not found
unable to import class com.opensymphony.xwork2.ActionContext not found  Imported class com.opensymphony.xwork2.ActionContext not found gettin the above error
http 404 resource not found error
http 404 resource not found error   Sir, I have downloaded your RichLRApplication and deployed on tomcat 6 with oracle backend. Application started... not found error. Kindly advise. ss
Java file not found exception
Java file not found exception This section illustrates you the concept of file not found exception. Java provides a powerful concept of Exceptions... by a code. When a file with the specified pathname does not exist, file not found
MySQL server PID file could not be found! [FAILED]
MySQL server PID file could not be found! [FAILED]  MySQL server PID file could not be found! [FAILED
exception handling code for file not found error..
exception handling code for file not found error..  How to do exception handling for file not found error
spring3 mvc appliation bean definition not found error
spring3 mvc appliation bean definition not found error  hi deepak I executed the spring3 registration validation example from rose india. when I execute it shows index page, when I click on link it shows the following error
spring3 mvc appliation bean definition not found error
spring3 mvc appliation bean definition not found error  hi I executed spring3 mvc with annotation example after clicking on the register page I got the following error, can you suggest me how to solve. The error message
No suitable driver found for jdbc:mysql://localhost:3306/TEST
No suitable driver found for jdbc:mysql://localhost:3306/TEST  hii, I have wrietten web project using jsp and hibernate but its not working. ava.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/TEST
JSP error: class UserForm not found in class model.UserAction
JSP error: class UserForm not found in class model.UserAction  etting the following error in the program..wat shod i do to remove this?I am using jdeveloper 10 g [code] package model; import javax.servlet.http.HttpServletRequest
data
data  Handling data
data
data  data Handling AOP
data
data  Handling data in AOP
data
data handling examples in AOP Model  data handling examples in AOP Model
Tag In Project POM To Close My Java Application If JRE 1.6 Is Not Found?
Tag In Project POM To Close My Java Application If JRE 1.6 Is Not Found?  I have an application compiled in Java. I build my code through Maven. I want a tag in my project POM, so that if JRE 1.6 is not found in the system during
How to found which class or method contain specific annotation?
How to found which class or method contain specific annotation?  Suppose we are having a class with separate user define annoation in same package... categories of testcase. i want to found method or class according to category
I don't found in Tomcat 7.0 's bin folder..
I don't found in Tomcat 7.0 's bin folder..  While making servlet using tomcat 7.0, i don't find startup.bat file in bin folder. My servlet is not working, what should i do ? Is it because of this my servlet is not working
This is the beautiful Coral color set that is mostly found in deep blue ocean.
found in deep blue ocean. Here is a set of 18 shades of Coral colors
i have installed oracle 10g (both ee and xe) editions... while am installing i found port num as 1521 for ee, 1522 for xe
found port num as 1521 for ee, 1522 for xe  i have installed oracle 10g (both ee and xe) editions... while am installing i found port num as 1521... SQLException{ DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver
importing data and edit that data
importing data and edit that data   hello sir i have data in excel sheet which contain 2 rows and i want to import that data to ms access and edit that data like adding new columns and new rows and creating new tables
Select data from diplicated data
Select data from diplicated data  hello i have table location..."; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); if ($db_found) { $SQL = "SELECT
save data DAO
save data DAO  how to save data in db   package...; } } catch (SQLException ex) { Logger.getLogger(UserDAO.class.getName...) { return false; } } catch (SQLException ex) { Logger.getLogger
what are the jar files should i add to resolve the Exception(Class org.apache.jsp.index_jsp Not Found) ?
what are the jar files should i add to resolve the Exception(Class org.apache.jsp.index_jsp Not Found) ?  what are the jar files should i add to resolve the following Exception HTTP Status 500 - type Exception report
data processing is
data processing is   data processing is   Data processing is associated with commercial work. Data processing is also referred as Information System. Data processing is basically used for analyzing, processing
 

 

 

DMCA.com