Skip to main content

Posts

Showing posts from December, 2013

SELECT | INSERT | DELETE IN JAVA USING MYSQL

import java.io.*; import java.sql.*; public class Insert { int vid,vage,vdid; String vnm;  Connection conn;  Statement st;  ResultSet rs;  String qry,driver,url;     public void read(int id,String name,int age)     {         vid=id;         vnm=name;         vage=age;     }     public void process()     {      try{         driver="com.mysql.jdbc.Driver"; //mysql database driver         url="jdbc:mysql://localhost/mukesh";         Class.forName(driver);         conn=DriverManager.getConnection(url,"root","kumar");                qry="insert into emp(eid,ename,eage) values("+vid+",'"+vnm+"',"+vage+")";         System.out.println("qry = "+qry);         st=c...

RADIO BUTTON COMPONENT OF AWT IN JAVA

import java.awt.*; import java.awt.event.*; class Radio implements ItemListener {     Frame fr;     Panel p;     CheckboxGroup cgp;     Checkbox c1,c2,c3;     private String msg;         public Radio()     {         fr=new Frame("RADIO BUTTON");         p=new Panel();         cgp=new CheckboxGroup();         c1=new Checkbox("CASH",cgp,true);         c2=new Checkbox("CHEQUE",cgp,false);         c3=new Checkbox("DEMAND DRAFT",cgp,false);         p.add(c1);         p.add(c2);         p.add(c3);         c1.addItemListener(this);         c2.addItemListener(this);         c3.addItemListener(this);         fr.add(p);   ...

CHECKBOX COMPONENT OF AWT IN JAVA

import java.awt.*; import java.awt.event.*; class ChkBox implements ItemListener {     Frame fr;     Panel p;     Checkbox c1,c2,c3;     private String msg;     public ChkBox()     {         fr=new Frame("CHECK BOX");         p=new Panel();         c1=new Checkbox("ONE");         c2=new Checkbox("TWO");         c3=new Checkbox("THREE");         p.add(c1);         p.add(c2);         p.add(c3);         c1.addItemListener(this);         c2.addItemListener(this);         c3.addItemListener(this);         fr.add(p);         fr.addWindowListener(new close());         fr.setSize(800,800);         fr.setVisible...

BUTTON COMPONENT OF AWT IN JAVA

import awt.*; import java.awt.*; import java.awt.event.*; class Buttoncolor implements ActionListener {     Frame fr;     Panel p;     Button b1,b2,b3,b4,b5;     Buttoncolor()     {         fr=new Frame("CLICK EVENT ON BUTTON COLOR AWT");         p=new Panel();                 b1=new Button("RED");         b2=new Button("GREEN");         b3=new Button("BLUE");         b4=new Button("YELLOW");         b5=new Button("BLACK");         p.add(b1);         p.add(b2);         p.add(b3);         p.add(b4);         p.add(b5);         b1.addActionListener(this);         b2.addActionListener(this);       ...

UNIX/LINUX COMMAND

Unix / Linux Command cat  --- for creating and displaying short files chmod  --- change permissions cd  --- change directory cp  --- for copying files date  --- display date echo  --- echo argument ftp  --- connect to a remote machine to download or upload files grep  --- search file head  --- display first part of file ls  --- see what files you have lpr  --- standard print command (see also  print  ) more  --- use to read files mkdir  --- create directory mv  --- for moving and renaming files ncftp  --- especially good for downloading files via anonymous  ftp . print  --- custom print command (see also  lpr  ) pwd  --- find out what directory you are in rm  --- remove a file rmdir  --- remove directory rsh  --- remote shell setenv  --- set an environment variable sort  --- sort file tail  --- display last part of file ta...