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



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ajay2124lv
SQLException caught: No data found
0 Answer(s)      2 years and 8 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
(); //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"/>
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"/> <
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
Advertisements
 

 

 

DMCA.com