Skip to main content

Posts

Showing posts from 2017

Java Program to Display record using JFrame and Prepaired Statement

Java Program to Display  record using JFrame and Prepaired Statement Java Program to Display  record using JFrame and Statement Here is table Design  Create table demo using two column as id  and Dname , id is primary key  Program source code  import javax.swing.*;   import java.awt.event.*;   import java.sql.*; public class FrameDisplay extends JFrame implements ActionListener{       JTextField tf1,tf2,tf3;       JButton b1,b2;      JLabel l1,l2;    String snm; Connection con;  Statement smt;   ResultSet rs; //declaration of control    FrameDisplay(){           JFrame f= new JFrame("Display Demo");   // l1=new JLabel("Enter RollNo"); l1.setBounds(150,10,150,50);         tf1=new JTextField();           tf1.setBounds(1...

Java Program to update record using JFrame and Prepaired Statement

Java Program to update record using JFrame and Prepaired Statement Java Program to edit record using JFrame and Prepaired Statement Here is table Design  Create table demo using two column as id  and Dname , id is primary key  Program source code  import javax.swing.*;   import java.awt.event.*;   import java.sql.*; public class FrameUpdate extends JFrame implements ActionListener{       JTextField tf1,tf2,tf3;       JButton b1,b2;   JLabel l1,l2; Connection con;    PreparedStatement psmt;   int result; //declaration of control   FrameUpdate(){           JFrame f= new JFrame("UpdateDemo");   // l1=new JLabel("Enter RollNo"); l1.setBounds(150,10,150,50);         tf1=new JTextField();           tf1.setBounds(150,50,150,20);   ...

Java Program to delete record using JFrame and Prepaired Statement

Java Program to delete record using JFrame and Prepaired Statement Here is table Design  Create table demo using two column as id  and Dname , id is primary key  Program source code  +import javax.swing.*;   import java.awt.event.*;   import java.sql.*; public class FrameDelete extends JFrame implements ActionListener{       JTextField tf1,tf2,tf3;       JButton b1,b2;   JLabel l1,l2; Connection con;    PreparedStatement psmt;   int result; //declaration of control    FrameDelete(){           JFrame f= new JFrame("InsertDemo");   // l1=new JLabel("Enter RollNo"); l1.setBounds(150,10,150,50);         tf1=new JTextField();           tf1.setBounds(150,50,150,20);   tf3=new JTextField();           tf3.setBounds(1...

java insert using JFrame and Prepaired Statement

Java Program to insert record using JFrame and Prepaired Statement Here is table Design  Create table demo using two column as id  and Dname , id is primary key  Program source code  import javax.swing.*;   import java.awt.event.*;   import java.sql.*; public class FrameInsert extends JFrame implements ActionListener{       JTextField tf1,tf2,tf3;       JButton b1,b2;   JLabel l1,l2; Connection con;    PreparedStatement psmt;   int result; //declaration of control    FrameInsert(){           JFrame f= new JFrame("InsertDemo");   // l1=new JLabel("Enter RollNo"); l1.setBounds(150,10,150,50);         tf1=new JTextField();           tf1.setBounds(150,50,150,20);   l2=new JLabel("Enter Name"); l2.setBounds(150,60,150,5...

jbutton Click Event example Advance Java

Jbutton Click Event example Advance Java  Change frame Color On Button click Advance Java  import javax.swing.*; import java.awt.*; import java.awt.event.*;      class FrameDemo extends JFrame implements ActionListener {       JButton btn; Container c;          FrameDemo() {               c=this.getContentPane();        JButton btn= new JButton("Click"); btn.setBounds(100,50,100,50);         c.add(btn);         c.setLayout(null);        btn.addActionListener(this); }                    public void actionPerformed(ActionEvent a) {                     c.setBackground(Color.RED); } }        // cre...

Advance Java Login Form

Advance Java Login Form,  java login form using jframe   import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.Color; public class Login extends JFrame { public Login() {     setTitle("Login Form"); getContentPane().setBackground(Color.pink);      setSize(300,200);      setLayout(null);      setDefaultCloseOperation(EXIT_ON_CLOSE);    setLocation(400, 200);           JLabel l0=new JLabel("Login Form");        l0.setBounds(150,10,100,20);   add(l0);  JLabel l1=new JLabel("Enter User Name");  l1.setBounds(30,50,100,20);  add(l1);      JTextField textFieldUserName = new JTextField(50);     textFieldUserName.setBounds(140,50,80,20);       add(textFieldUserName);    JLabel l2=new JLabel("Enter Password...

Calculator Program using jFrame

Calculator Program using jFrame java swing calculator example java jframe calculator source code java code for simple calculator using gui how to make a calculator in advance java using JFrame simple calculator program in java using frame simple calculator program in java source code write a code to create simple calculator using swing component import javax.swing.*; import java.awt.event.*; public class TextFieldExample extends JFrame implements ActionListener{     JTextField tf1,tf2,tf3;     JButton b1,b2; //declaration of control     TextFieldExample(){         JFrame f= new JFrame("Button click demo"); //         tf1=new JTextField();         tf1.setBounds(50,50,150,20);         tf2=new JTextField();         tf2.setBounds(50,100,150,20);         tf3=new JTextField();       ...

Jframe Form Designing sample

Advance JAva-Jframe Form Designing sample Code import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.Color; public class Sample extends JFrame  { public Sample() {     setTitle("Home");      getContentPane().setBackground(Color.orange);       setSize(300,200);      setLayout(null);         setDefaultCloseOperation(EXIT_ON_CLOSE);      setLocation(100, 100);              JLabel l0=new JLabel("Registration");        l0.setBounds(10,0,100,20);   add(l0);  JLabel l1=new JLabel("Enter Name");  l1.setBounds(30,20,100,20);  add(l1);      JTextField textFieldUserName = new JTextField(50);     textFieldUserName.setBounds(110,20,60,20);     ...

Advance Java jframe SimpleTutorial

How to Create Java frame Application Siple Program Advance Java jframe  SimpleTutorial  import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.Color; public class One extends JFrame { public One() {        getContentPane().setBackground(Color.orange);        setSize(300,200);        setLayout(null);        setDefaultCloseOperation(EXIT_ON_CLOSE);         setLocation(100, 100);          setVisible(true); } public static void main(String s[]) { One obj=new One(); } }

java project using CMD Source Code Download

java project using CMD Source Code Download import java.sql.*; import java.*; import java.io.*; class whileInfinite { public static void main(String s[]) {  try{ while(true) { System.out.println("Select Your Choice :"); System.out.println("________________________________________"); System.out.println("1. Insert record :"); System.out.println("2. disply all records :"); System.out.println("3. display Specific record :"); System.out.println("4. update record:"); System.out.println("5. delete Record:"); System.out.println("6. Exit:"); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));           System.out.println("Enter your choice"); int choice = Integer.parseInt(reader.readLine()); System.out.println("yo entered"+ choice); switch(choice) { case 1:whileInfinite obj=new whileInfin...

accept value from user using bufffered reader and insert into msaccess database

accept value from user using buffered reader and insert into ms access database import java.sql.*; import java.io.*; class BufferedInsert { public static void main(String s[]) { try {              BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));              // it is used to accept value runtime System.out.println("Enter The name"); String nm = reader.readLine();  System.out.println("Enter The ID");     int id = Integer.parseInt(reader.readLine()); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //driver load             Connection con=DriverManager.getConnection("jdbc:odbc:demodb"); // connection             PreparedStatement psmt=con.prepareStatement("insert into demo(id,dname)values(?,?)"); psmt.setInt(1,id); psmt.setString(2,nm); ...

java program insert record using PreparedStatement

java program insert  record  using  PreparedStatement java MS ACCESS  insert,update  delete using  PreparedStatement import java.sql.*; class InsertPs { public static void main(String s[]) { try{ int id=Integer.parseInt(s[0]); String nm=s[1]; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:demodb"); PreparedStatement psmt=con.prepareStatement("insert into demo(id,dname)values(?,?)"); psmt.setInt(1,id); psmt.setString(2,nm); int result=psmt.executeUpdate(); System.out.println("record Inserted"+result); con.close(); } catch(Exception e) {System.out.println(""+e);} } } Learn Delete record from MS ACCESS USING PREPAIRED STATEMENT CLICK HERE insert query in java using prepared statement how to insert values into table in mysql using java how to use prep...

java MS ACCESS insert,update delete using PreparedStatement

java program delete record from table using  PreparedStatement java MS ACCESS  insert,update  delete using  PreparedStatement import java.sql.*; class DeletePreparest {   public static void main(String s[])   {     try {   int cno=Integer.parseInt(s[0]);  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");  Connection con=DriverManager.getConnection("jdbc:odbc:demodb"); // Statement smt=con.createStatement();  PreparedStatement psmt=con.prepareStatement("delete from demo where id=?");  psmt.setInt(1,cno);  int result=psmt.executeUpdate();       System.out.println("record deleted"+result);  con.close(); } catch(Exception e){    System.out.println("exce"+e);}         } }

java ms access connectivity

java ms access connectivity java ms access connectivity Step by Step jdbc odbc driver for ms access java database connectivity with ms access 2007 java ms access connectivity steps how to connect java with ms access 2007 database with an example how to connect ms access database in java without dsn how to connect ms access database in java without using dsn Hi Friends in this article i am using ms access 2007 database as a back end, using java simple code we will connect to emp database created in ms access , after connecting with emp we are going to perform operation like display records from emp using java simple code, add record to emp using java simple code, delete record from emp using java simple code , update /edit emp using java simple code , i am using simple because vary basic code you found here . follow steps you can watch video or download PDF very Soon  for this article .  First  Create Table  use MS ACCESS 2007 or later as shown in imag...

Labels

Show more