Sunteți pe pagina 1din 78

ACKNOWLEDGEMENT

At the outset I am especially indebted to lord almighty for flooding his grace and blessings on me in all
aspects to terminate this project on fine manner and schedule.

I thank my informatics practioner teacher Mrs.Julie Rajesh for conceiving in me the required confidence to
incorporate this project and nurture me with constructive suggestions and critical insights to wind up this
project.

I also express thanks to my fellow batch mates who with small but really helpful guidance stood beside me to
develope this work.

thank you all

1
CONTENTS

i. system requirments and


specifications
ii. introducton
iii. database dictionary
iv. source code
v. output
vi. biblogrraphy

2
PROJECT AT A GLANCE

Agro SOFT management software is a user-friendly application


which helps the common busy farmers to audit there expense and
calculate their gains on a daily bases than the conventional paper-
pen-accounting method. It helps us in analyzing the day to day
activities in the farm with accurate calculations according to each
and overall sector of farming practiced.

The project mainly contains the following forms-

LOGIN PAGE
The user enters correct login username and password to enter into
the home menu.

HOME MENU
A door to different sectors of animal agricultural sector managed.

CATTLE SECTOR
Auditing of daily expense and earnings and its tabulation.the overall
gain in this sector can also be known.

POULTRY SECTOR
Auditing of daily expense and earnings and its tabulation.the overall
gain in this sector can also be known.

3
RABBIT SECTOR
Auditing of daily expense and earnings and its tabulation.the overall
gain in this sector can also be known.

EXOTIC PETS SECTOR


Auditing of daily expense and earnings and its tabulation.the overall
gain in this sector can also be known.

OVERALL EVALUATION
The overall evaluation of the complete sector is displayed with the
overall PROFIT or LOSS.

4
system requirments and
specifications

To develop a new system ,certain hardware and software


specifications are needed.

SYSTEM REQUIRMENTS
1.system-IBM-compatiable
2.prcessor-Pentium 4
3.Speed-2.0GHz
4.Hard Disk-20GB

HARDWARE SPECIFICATIONS

1.Operating System-Windows XP or above


2.Development Environment-Net Beans
3.Language used=Java
4.Front End-Java
5.Back End-Mysql

5
Database
Dictionary

TABLES IN MYSQL

Cattle
Field Type Null Default
eid int(11) YES NULL
vac int(11) YES NULL
mant int(11) YES NULL
feed int(11) YES NULL
bio int(11) YES NULL
milk int(11) YES NULL
date YES NULL
char(78)
int(11) YES NULL
number

RABBIT
Field Type Null Default
eid int(11) YES NULL
vac int(11) YES NULL
mant int(11) YES NULL
feed int(11) YES NULL
bio int(11) YES NULL
milk int(11) YES NULL
date char(78) YES NULL
number int(11) YES NULL

6
POULTRY
Field Type Null Default

eid int(11) YES NULL


vac int(11) YES NULL
mant int(11) YES NULL
feed int(11) YES NULL
bio int(11) YES NULL
fur int(11) YES NULL
date char(45) YES NULL
number int(11) YES NULL

EXOTIC
Field Type Null Default
id int(11) YES NULL
breed char(47) YES NULL
no int(11) YES NULL
mant int(11) YES NULL
feed int(11) YES NULL
price int(11) YES NULL
date char(45) YES NULL

SELLCATTLE
Field Type Null Default
iid int(11) YES NULL
sell int(11) YES NULL

SELLRABBIT
Field Type Null Default
iid int(11) YES NULL
sell int(11) YES NULL

7
SELLPOULTRY
Field Type Null Default
iid int(11) YES NULL
sell int(11) YES NULL

SELLEXOTIC
Field Type Null Default
iid int(11) YES NULL
sell int(11) YES NULL

8
LOGIN FRAME
import javax.swing.JOptionPane;
public class login extends javax.swing.JFrame {
public login() {
initComponents() }
private void LOGIN ActionPerformed(java.awt.event.ActionEvent evt) {
String t1a=t1.getText();
String t2b=t2.getText();
String a="ericj";
String b="qwerty";
if(t1a.equalsIgnoreCase(a) && t2b.equalsIgnoreCase(b))
{JOptionPane.showMessageDialog(null,"User verified");
HOME ac = new HOME();
ac.setVisible(true);
this.dispose();}
else
{JOptionPane.showMessageDialog(null,"User not verified,TRY AGAIN");
t1.setText("");
t2.setText("");}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new exoticsell().setVisible(true);
}}); }

9
HOME FRAME
public class HOME extends javax.swing.JFrame {
public HOME() {
initComponents();}
private void EXOTIC MouseClicked(java.awt.event.MouseEvent evt) {
exotic a=new exotic();
a.setVisible(true);
this .dispose();}
private void RABBIT MouseClicked(java.awt.event.MouseEvent evt) {
rabitdat rb=new rabitdat();
rb.setVisible(true);
this.dispose(); }
private void CATTLE MouseClicked(java.awt.event.MouseEvent evt) {
cattledat rb=new cattledat();
rb.setVisible(true);
this.dispose(); }
private void POULTRY MouseClicked(java.awt.event.MouseEvent evt) {
poultrydat rb=new poultrydat();
rb.setVisible(true);
this.dispose(); }
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
evltable w2 = new evltable();
w2.setVisible(true);
this.dispose();}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
10
public void run() {
new HOME().setVisible(true);
}}); }

CATTLE DATE

import java.sql.*;
import javax.swing.JOptionPane;
public class cattledat extends javax.swing.JFrame {
public cattledat() {
initComponents();}

public static String s1,s2,s3;


private void cb1ActionPerformed(java.awt.event.ActionEvent evt) {
s1=(String) cb1.getSelectedItem();
t1.setText(s1);}
private void cb3ActionPerformed(java.awt.event.ActionEvent evt) {
s3=(String) cb3.getSelectedItem();
t3.setText(s3);}
private void cb2ActionPerformed(java.awt.event.ActionEvent evt) {
s2=(String) cb2.getSelectedItem();
t2.setText(s2);}
private void formWindowActivated(java.awt.event.WindowEvent evt) {
cb3.setSelectedIndex(3);
t3.setText("");}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
cattle ac = new cattle();
11
ac.setVisible(true);
this.dispose();}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
HOME w = new HOME();
w.setVisible(true);
this.dispose();}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new cattledat().setVisible(true);
}});}

CATTLE
import java.sql.*;
import javax.swing.JOptionPane;
public class cattle extends javax.swing.JFrame {
public cattle() {

initComponents();}
int t,to;
ResultSet rs,ab,b;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int tt=Integer.parseInt(totanimal.getText());
int nno=Integer.parseInt(nw.getText());
int dno=Integer.parseInt(dd.getText());
tt=tt+nno-dno;
12
int v,f,man,bio,milk;
if(t1.getText().equals(""))
v=0;
else
v =Integer.parseInt(t1.getText());
if(t2.getText().equals(""))
man=0;
else
man=Integer.parseInt(t2.getText());
if(t3.getText().equals(""))
f=0;
else
f=Integer.parseInt(t3.getText());
if(t4.getText().equals(""))
bio=0;
else
bio=Integer.parseInt(t4.getText());
if(z.getText().equals(""))
milk=0;
else
milk =Integer.parseInt(z.getText());
cattledat c=new cattledat();
String dat=(c.s1+"-"+c.s2+"-"+c.s3);
try
{Class.forName("java.sql.DriverManager");

13
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from cattle;");
rs.last();
int id =rs.getInt(1);
int newid=id + 1;
st.executeUpdate("insert into cattle
values("+newid+","+v+","+man+","+f+","+bio+","+milk+","+"'"+dat+"'"+","+tt+"
);");
}catch(Exception e)
{System.out.println(e.getMessage());}
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
b=st.executeQuery("select * from cattle;");
b.last();
int to=b.getInt(8);
totanimal.setText(""+to);
}catch(Exception e)
{System.out.println(e.getMessage());}
nw.setText("");
dd.setText("");
t1.setText("");
t2.setText("");
14
t4.setText("");
t3.setText("");
z.setText("");
y.setText("");
x.setText("");}
private void zMouseClicked(java.awt.event.MouseEvent evt) {
int x1 =Integer.parseInt(x.getText());
int y1 =Integer.parseInt(y.getText());
z.setText(""+x1*y1);
}
private void formWindowActivated(java.awt.event.WindowEvent evt) {
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
b=st.executeQuery("select * from cattle;");
b.last();
int t=b.getInt(8);
totanimal.setText(""+t);
}catch(Exception e)
{System.out.println(e.getMessage());}
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
cattledat w = new cattledat();
w.setVisible(true);

15
this.dispose(); }
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
cattletable aa = new cattletable();
aa.setVisible(true);
this.dispose();}
private void
jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
cattelsell ab = new cattelsell();
ab.setVisible(true);
this.dispose(); }

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new cattle().setVisible(true);
}}); }

CATTTLE SELL

import java.sql.*;
public class cattelsell extends javax.swing.JFrame {
public cattelsell() {
initComponents();}

ResultSet rs,ra; int est, ano , cno ,aprice ,cprice,dno,nno;


public static int w;
16
private void t5MouseClicked(java.awt.event.MouseEvent evt) {
ano =Integer.parseInt(t1.getText());
cno =Integer.parseInt(t2.getText());
aprice =Integer.parseInt(t55.getText());
cprice =Integer.parseInt(t4.getText());
est=(ano*aprice)+(cno*cprice);
t5.setText(""+est);}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from cattle;");
rs.last();
int t=rs.getInt(8);
int id =rs.getInt(1);
if(t1.getText().equals(""))
nno=0;
else
dno=Integer.parseInt(t1.getText());
if(t1.getText().equals(""))
dno=0;
else
dno=Integer.parseInt(t2.getText());
t=t+nno-dno;

17
st.executeUpdate("update cattle set number="+t+" where eid="+id+";");
w=(ano*aprice)+(cno*cprice);
ra=st.executeQuery("select * from sellcattle;");
ra.last();
int iid =ra.getInt(1);
iid=iid+1;
st.executeUpdate("insert into sellcattle values("+iid+","+w+");");
}catch(Exception e) {
System.out.println(e.getMessage());}}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
cattle w2 = new cattle();
w2.setVisible(true);
this.dispose}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new cattelsell().setVisible(true);
}});}

CATTLE TABLE
import java.sql.*;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
public class cattletable extends javax.swing.JFrame {
public cattletable() {
initComponents();}
18
ResultSet rs,b,ra;
public static int cp, sp,evl;
private void formWindowActivated(java.awt.event.WindowEvent evt) {
DefaultTableModel tb=(DefaultTableModel)this.tb2.getModel();
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from cattle;");
while(rs.next())
{String a=rs.getString(7);
String b=rs.getString(4);
String c=rs.getString(2);
String d=rs.getString(3);
String e=rs.getString(6);
String f=rs.getString(5);
Object o[]={a,b,c,d,e,f};
tb.addRow(o);}
}catch(Exception e)
{System.out.println(e.getMessage());}}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
19
Statement st=con.createStatement();
b=st.executeQuery("select (sum(vac)+sum(mant)+sum(feed)) from cattle;");
b.first();
cp=b.getInt(1);
b=st.executeQuery("select (sum(milk)+sum(bio)) from cattle;");
b.first();
sp=b.getInt(1);
ra=st.executeQuery("select sum(sell) from sellcattle;");
int sell=ra.getInt(1);
sp=sp+sell;
}catch(Exception e) {
System.out.println(e.getMessage());}
evl=sp-cp;
t1.setText(""+cp);
t2.setText(""+sp);
t3.setText(""+evl);}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
cattle w1 = new cattle();
w1.setVisible(true);
this.dispose();}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new cattletable().setVisible(true);
}});}

20
RABBIT DATE
public class rabitdat extends javax.swing.JFrame {
public rabitdat() {
initComponents();}

public static String s1,s2,s3;


private void cb1ActionPerformed(java.awt.event.ActionEvent evt) {
s1=(String) cb1.getSelectedItem();
t1.setText(s1); }
private void cb3ActionPerformed(java.awt.event.ActionEvent evt) {
s3=(String) cb3.getSelectedItem();
t3.setText(s3);}
private void cb2ActionPerformed(java.awt.event.ActionEvent evt) {
s2=(String) cb2.getSelectedItem();
t2.setText(s2); }
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
rabbits ac = new rabbits();
ac.setVisible(true);
this.dispose();}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
HOME w = new HOME();
w.setVisible(true);
this.dispose(); }

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
21
new rabitdat().setVisible(true);
}});}

RABBIT
import java.sql.*;
public class rabbits extends javax.swing.JFrame {
public rabbits() {
initComponents();}

ResultSet rs,ab,b;
int t,to;
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
rabbitsell ab = new rabbitsell();
ab.setVisible(true);
this.dispose();}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int tt=Integer.parseInt(totanimal.getText());
int nno=Integer.parseInt(nw.getText());
int dno=Integer.parseInt(dd.getText());
tt=tt+nno-dno;
int v,f,man,bio,fur;
if(t1.getText().equals(""))
v=0;
else
v =Integer.parseInt(t1.getText());
if(t2.getText().equals(""))
man=0;
22
else
man=Integer.parseInt(t2.getText());
if(t3.getText().equals(""))
f=0;
else
f=Integer.parseInt(t3.getText());
if(t4.getText().equals(""))
bio=0;
else
bio=Integer.parseInt(t4.getText());
if(z.getText().equals(""))
fur=0;
else
fur =Integer.parseInt(z.getText());
rabitdat c=new rabitdat();
String dat=(c.s1+"-"+c.s2+"-"+c.s3);
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from rabbit;");
rs.last();
int id =rs.getInt(1);
int newid=id + 1;

23
st.executeUpdate("insert into rabbit
values("+newid+","+v+","+man+","+f+","+bio+","+fur+","+"'"+dat+"'"+","+tt+");
");
}catch(Exception e)
{System.out.println(e.getMessage());}
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from rabbit;");
rs.last();
to=rs.getInt(8);
}catch(Exception e)
{System.out.println(e.getMessage());}
totanimal.setText(""+to);
nw.setText("");
dd.setText("");
t1.setText("");
t2.setText("");
t4.setText("");
z.setText("");
}
private void formWindowActivated(java.awt.event.WindowEvent evt) {
try
{Class.forName("java.sql.DriverManager");

24
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
b=st.executeQuery("select * from rabbit;");
b.last();
int t=b.getInt(8);
totanimal.setText(""+t);
}catch(Exception e)
{System.out.println(e.getMessage());}}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
rabitdat aa = new rabitdat();
aa.setVisible(true);
this.dispose();}
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
rabbittable aa = new rabbittable();
aa.setVisible(true);
this.dispose();}
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
rabbitsell w = new rabbitsell();
w.setVisible(true);
this.dispose();}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new rabbits().setVisible(true);

25
}});}

RABBIT SELL
import java.sql.*;
public class rabbitsell extends javax.swing.JFrame {
public rabbitsell() {
initComponents();}

ResultSet rs,ra; int est, ano , cno ,aprice ,cprice,dno,nno ;


public static int w;
private void t5MouseClicked(java.awt.event.MouseEvent evt) {
ano =Integer.parseInt(t1.getText());
cno =Integer.parseInt(t2.getText());
aprice =Integer.parseInt(t55.getText());
cprice =Integer.parseInt(t4.getText());
est=(ano*aprice)+(cno*cprice);
t5.setText(""+est);}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from rabbit;");
rs.last();
int t=rs.getInt(8);

26
int id =rs.getInt(1);
if(t1.getText().equals(""))
nno=0;
else
dno=Integer.parseInt(t1.getText());
if(t1.getText().equals(""))
dno=0;
else
dno=Integer.parseInt(t2.getText());
t=t+nno-dno;
st.executeUpdate("update rabbit set number="+t+" where eid="+id+";");
w=(ano*aprice)+(cno*cprice);
ra=st.executeQuery("select * from sellrabbit;");
ra.last();
int iid =ra.getInt(1);
iid=iid+1;
st.executeUpdate("insert into sellrabbit values("+iid+","+w+");");
}catch(Exception e) {
System.out.println(e.getMessage());}}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
rabbits w2 = new rabbits();
w2.setVisible(true);
this.dispose();}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new rabbitsell().setVisible(true);
27
}});}

RABBIT TABLE
import java.sql.*;
import javax.swing.table.DefaultTableModel;
public class rabbittable extends javax.swing.JFrame {
public rabbittable() {
initComponents();}

ResultSet rs,ra,b;
public static int cp, sp,evl;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
jButton1.setVisible(false);
try {
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
b=st.executeQuery("select (sum(vac)+sum(mant)+sum(feed)) from rabbit;");
b.first();
cp=b.getInt(1);
b=st.executeQuery("select (sum(fur)+sum(bio)) from rabbit;");
b.first();
sp=b.getInt(1);
ra=st.executeQuery("select sum(sell) from sellrabbit;");
int sell=b.getInt(1);

28
sp=sp+sell;
}catch(Exception e) {
System.out.println(e.getMessage());}
evl=sp-cp;
jPanel2.setVisible(true);
t1.setText(""+cp);
t2.setText(""+sp);
t3.setText(""+evl);}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
rabbits w1 = new rabbits();
w1.setVisible(true);
this.dispose();}}
private void formWindowActivated(java.awt.event.WindowEvent evt) {
DefaultTableModel tb=(DefaultTableModel)this.tb2.getModel();
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from rabbit;");
while(rs.next())
{String a=rs.getString(7);
String b=rs.getString(4);
String c=rs.getString(2);
String d=rs.getString(3);
String e=rs.getString(6);

29
String f=rs.getString(5);
Object o[]={a,b,c,d,e,f};
tb.addRow(o);}
}catch(Exception e)
{System.out.println(e.getMessage());}}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new rabbittable().setVisible(true);
}});}

POULTRY DATE
public class poultrydat extends javax.swing.JFrame {
public poultrydat() {
initComponents();}

public static String s1,s2,s3;


private void cb1ActionPerformed(java.awt.event.ActionEvent evt) {
s1=(String) cb1.getSelectedItem();
t1.setText(s1); }
private void cb3ActionPerformed(java.awt.event.ActionEvent evt) {
s3=(String) cb3.getSelectedItem();
t3.setText(s3);}
private void cb2ActionPerformed(java.awt.event.ActionEvent evt) {
s2=(String) cb2.getSelectedItem();
t2.setText(s2);}
30
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
poultryy ac = new poultryy();
ac.setVisible(true);
this.dispose();}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
HOME w = new HOME();
w.setVisible(true);
this.dispose(); }

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new poultrydat().setVisible(true);
}});}

POULTRY
import java.sql.*;
public class poultryy extends javax.swing.JFrame {
public poultryy() {
initComponents();}

ResultSet rs,ab,b;
int t;
private void zMouseClicked(java.awt.event.MouseEvent evt) {
int x1 =Integer.parseInt(x.getText());
int y1 =Integer.parseInt(y.getText());
z.setText(""+x1*y1);}
31
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
int tt=Integer.parseInt(totanimal.getText());
int nno=Integer.parseInt(nw.getText());
int dno=Integer.parseInt(dd.getText());
tt=tt+nno-dno;
int v,f,man,bio,egg;
if(t1.getText().equals(""))
v=0;
else
v =Integer.parseInt(t1.getText());
if(t2.getText().equals(""))
man=0;
else
man=Integer.parseInt(t2.getText());
if(t3.getText().equals(""))
f=0;
else
f=Integer.parseInt(t3.getText());
if(t4.getText().equals(""))
bio=0;
else
bio=Integer.parseInt(t4.getText());
if(z.getText().equals(""))
egg=0;
else
egg =Integer.parseInt(z.getText());
poultrydat c=new poultrydat();
32
String dat=(c.s1+"-"+c.s2+"-"+c.s3);
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from poultry;");
rs.last();
int id =rs.getInt(1);
int newid=id + 1;
st.executeUpdate("insert into poultry
values("+newid+","+v+","+man+","+f+","+bio+","+egg+","+"'"+dat+"'"+","+tt+");
");
}catch(Exception e)
{System.out.println(e.getMessage());}}
private void formWindowActivated(java.awt.event.WindowEvent evt) {
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
b=st.executeQuery("select * from poultry;");
b.last();
int t=b.getInt(8);
totanimal.setText(""+t);
}catch(Exception e)
{System.out.println(e.getMessage());}}
33
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
poultrydat w = new poultrydat();
w.setVisible(true);
this.dispose();}
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
poultrytable aa = new poultrytable();
aa.setVisible(true);
this.dispose();}
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
poultrysell ab = new poultrysell();
ab.setVisible(true);
this.dispose();}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new poultryy().setVisible(true);
}});
}

POULTRY SELL
import java.sql.*;
public class poultrysell extends javax.swing.JFrame {
public poultrysell() {
initComponents();}

ResultSet rs,ra; int est, ano , cno ,aprice ,cprice,nno,dno ;


public static int w;
34
private void t5MouseClicked(java.awt.event.MouseEvent evt) {
ano =Integer.parseInt(t1.getText());
cno =Integer.parseInt(t2.getText());
aprice =Integer.parseInt(t55.getText());
cprice =Integer.parseInt(t4.getText());
est=(ano*aprice)+(cno*cprice);
t5.setText(""+est);}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from poultry;");
rs.last();
int t=rs.getInt(8);
int id =rs.getInt(1);
if(t1.getText().equals(""))
nno=0;
else
dno=Integer.parseInt(t1.getText());
if(t1.getText().equals(""))
dno=0;
else
dno=Integer.parseInt(t2.getText());
t=t+nno-dno;

35
st.executeUpdate("update poultry set number="+t+" where eid="+id+";");
w=(ano*aprice)+(cno*cprice);
ra=st.executeQuery("select * from sellpoultry;");
ra.last();
int iid =ra.getInt(1);
iid=iid+1;
st.executeUpdate("insert into sellpoultry values("+iid+","+w+");");
}catch(Exception e) {
System.out.println(e.getMessage());}
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
poultryy w2 = new poultryy();
w2.setVisible(true);
this.dispose();}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new poultrysell().setVisible(true);
}});
}
POULTRY TABLE
import java.sql.*;
import javax.swing.table.DefaultTableModel;
public class poultrytable extends javax.swing.JFrame {
public poultrytable() {
initComponents();}
36
ResultSet rs,ra,b;
public static int cp, sp,evl;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
b=st.executeQuery("select (sum(vac)+sum(mant)+sum(feed)) from poultry;");
b.first();
cp=b.getInt(1);
b=st.executeQuery("select (sum(fur)+sum(bio)) from poultry;");
b.first();
sp=b.getInt(1);
ra=st.executeQuery("select sum(sell) from sellpoultry;");
int sell=b.getInt(1);
sp=sp+sell;
}catch(Exception e) {
System.out.println(e.getMessage());}
evl=sp-cp;
t1.setText(""+cp);
t2.setText(""+sp);
t3.setText(""+evl);}
private void formWindowActivated(java.awt.event.WindowEvent evt) {
DefaultTableModel tb=(DefaultTableModel)this.tb2.getModel();

37
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from poultry;");
while(rs.next())
{String a=rs.getString(7);
String b=rs.getString(4);
String c=rs.getString(2);
String d=rs.getString(3);
String e=rs.getString(6);
String f=rs.getString(5);
Object o[]={a,b,c,d,e,f};
tb.addRow(o);}
}catch(Exception e)
{System.out.println(e.getMessage());}}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
poultryy w1 = new poultryy();
w1.setVisible(true);
this.dispose();}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new poultrytable().setVisible(true);

38
}});
}

EXOTIC
import java.sql.*;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
public class exotic extends javax.swing.JFrame {
public exotic() {
initComponents();}

ResultSet rs;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
exoticinsert ac = new exoticinsert();
ac.setVisible(true);
this.dispose();}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
JOptionPane.showMessageDialog(null,"Congragulation your record is updated ");
int f,man;
if(t1.getText().equals(""))
f=0;
else
f=Integer.parseInt(t1.getText());
if(t2.getText().equals(""))
man=0;
else
man=Integer.parseInt(t2.getText());
39
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
DefaultTableModel tb=(DefaultTableModel)this.tb2.getModel();
int z=tb2.getSelectedRow();
int idd=z+1;
st.executeUpdate("update exotic set feed="+f+" , mant="+man+" where
id="+idd+";");
}catch(Exception e)
{System.out.println(e.getMessage());}}
private void SELLINGActionPerformed(java.awt.event.ActionEvent evt) {
exoticsell ac = new exoticsell();
ac.setVisible(true);
this.dispose();}
private void formWindowActivated(java.awt.event.WindowEvent evt) {
DefaultTableModel tb=(DefaultTableModel)this.tb2.getModel();
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from exotic;");
while(rs.next())
{String a=rs.getString(1);

40
String b=rs.getString(7);
Statement st=con.createStatement();
rs=st.executeQuery("select * from exotic
String c=rs.getString(2);
String d=rs.getString(3);
String e=rs.getString(5);
String f=rs.getString(4);
String g=rs.getString(6);
Object o[]={a,b,c,d,e,f,g};
tb.addRow(o);
int z=tb2.getRowCount();
tt.setText(""+z);}
}catch(Exception e)
{System.out.println(e.getMessage());}}
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
HOME w = new HOME();
w.setVisible(true);
this.dispose(); }
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
exoticeval ac = new exoticeval();
ac.setVisible(true);
this.dispose();}
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
exoticsell ac = new exoticsell();
ac.setVisible(true);
this.dispose();}

41
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new exotic().setVisible(true);
}});
}

EXOTIC INSERT
public class exoticinsert extends javax.swing.JFrame {
public exoticinsert() {
initComponents();}

String s1,s2,s3;
ResultSet rs,ab,b;
private void cb1ActionPerformed(java.awt.event.ActionEvent evt) {
s1=(String) cb1.getSelectedItem();
t1.setText(s1);}
private void cb3ActionPerformed(java.awt.event.ActionEvent evt) {
s3=(String) cb3.getSelectedItem();
t3.setText(s3);}
private void cb2ActionPerformed(java.awt.event.ActionEvent evt) {
s2=(String) cb2.getSelectedItem();
t2.setText(s2);}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int f=0,man=0,no;
String breed=x.getText();
no=Integer.parseInt(y1.getText());
42
String dat=(s1+"-"+s2+"-"+s3);
int price=Integer.parseInt(p.getText())*no;
try
{Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
;");
rs.last();
int id =rs.getInt(1);
int newid=id + 1;
st.executeUpdate("insert into exotic
values("+newid+","+"'"+breed+"'"+","+no+","+man+","+f+","+price+","+"'"+dat+
"'"+");");
}catch(Exception e)
{System.out.println(e.getMessage());}}
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
exotic w = new exotic();
w.setVisible(true);
this.dispose();}}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new exoticinsert().setVisible(true);
}});
}

43
EXOTIC SELL
import java.sql.*;
import javax.swing.JOptionPane;
public class exoticsell extends javax.swing.JFrame {
public exoticsell() {
initComponents();}

int x,y,q,o,m,t,bid;
ResultSet rs,ra,rb;
private void t5MouseClicked(java.awt.event.MouseEvent evt) {
bid=Integer.parseInt(t1.getText());
y =Integer.parseInt(t2.getText());
q =Integer.parseInt(t3.getText());
o=q*y;
t5.setText(""+o);}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try
{
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
rs=st.executeQuery("select * from exotic where id="+bid+";");
rs.first();
t=rs.getInt(3);
m=t-y;

44
if(m>0)
{ra=st.executeQuery("select * from sellexotic;");
ra.last();
int ii=ra.getInt(1);
ii=ii+1;
st.executeUpdate("insert into sellexotic values("+ii+","+o+");");
st.executeUpdate("update exotic set no="+m+" where id="+bid+";");
}
else if(m==0)
{
ra=st.executeQuery("select * from sellexotic;");
ra.last();
int ii=ra.getInt(1);
ii=ii+1;
st.executeUpdate("insert into sellexotic values("+ii+","+o+");");
st.executeUpdate("delete from exotic where id="+bid+";");}
else if(m<0)
{JOptionPane.showMessageDialog(null,"SORRY THE ENTERED NUMBER
AND RECORD NUMBER DOSEN'T MATCH,try again");
t1.setText("");
t2.setText("");
t3.setText("");
t5.setText("");}
}catch(Exception e)
{System.out.println(e.getMessage());}
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
45
exotic aa = new exotic();
aa.setVisible(true);
this.dispose(); }
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new exoticsell().setVisible(true);
}});
}

EXOTIC TABLE

public class exoticeval extends javax.swing.JFrame {


public exoticeval() {
initComponents();}
ResultSet rs,ra,b;
public static int cp, sell,evl;

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


try {
Class.forName("java.sql.DriverManager");
46
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
b=st.executeQuery("select (sum(price)+sum(mant)+sum(feed)) from exotic;");
b.first();
cp=b.getInt(1);
ra=st.executeQuery("select sum(sell) from sellexotic;");
ra.first();
sell=ra.getInt(1);
evl=sell-cp;
}catch(Exception e) {
System.out.println(e.getMessage());}
jPanel2.setVisible(true);
t1.setText(""+cp);
t2.setText(""+sell);
t3.setText(""+evl);
}

private void formMouseClicked(java.awt.event.MouseEvent evt) {


exotic ac = new exotic();
ac.setVisible(true);
this.dispose();
}
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
exotic w = new exotic();
w.setVisible(true);

47
this.dispose();
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new exoticeval().setVisible(true);
}});
}

EVALUATION

import java.sql.*;
import javax.swing.JOptionPane;
public class evltable extends javax.swing.JFrame {
public evltable() {
initComponents();
}

ResultSet a,b;
int c1,c,c2;
ResultSet o,x;
int p1,p,p2;
ResultSet m,n;
int r1,r,r2;
ResultSet l,g;
int e1,e,e2;
48
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
a=st.executeQuery("select (sum(vac)+sum(mant)+sum(feed)) from cattle;");
a.first();
c1=a.getInt(1);
a=st.executeQuery("select (sum(milk)+sum(bio)) from cattle;");
a.first();
c2=a.getInt(1);
b=st.executeQuery("select sum(sell) from sellcattle;");
int sell=b.getInt(1);
c2=c2+sell;
}catch(Exception e) {
System.out.println(e.getMessage());}
c=c2-c1;
ca1.setText(""+c1);
ca2.setText(""+c2);
ca.setText(""+c);
try {
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
49
Statement st=con.createStatement();
o=st.executeQuery("select (sum(vac)+sum(mant)+sum(feed)) from poultry;");
b.first();
p1=b.getInt(1);
o=st.executeQuery("select (sum(fur)+sum(bio)) from poultry;");
o.first();
p2=o.getInt(1);
x=st.executeQuery("select sum(sell) from sellpoultry;");
int sell=x.getInt(1);
p1=p1+sell;
}catch(Exception e) {
System.out.println(e.getMessage());}
p=p2-p1;
po1.setText(""+p1);
po2.setText(""+p2);
po.setText(""+p);
try {
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
m=st.executeQuery("select (sum(vac)+sum(mant)+sum(feed)) from rabbit;");
m.first();
r1=m.getInt(1);
m=st.executeQuery("select (sum(fur)+sum(bio)) from rabbit;");
m.first();

50
r2=m.getInt(1);
n=st.executeQuery("select sum(sell) from sellrabbit;");
int sell=n.getInt(1);
r2=r2+sell;
}catch(Exception e) {
System.out.println(e.getMessage());}
r=r2-r1;
ra1.setText(""+r1);
ra2.setText(""+r2);
ra.setText(""+r);
try {
Class.forName("java.sql.DriverManager");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/ericproject","root
","root");
Statement st=con.createStatement();
l=st.executeQuery("select (sum(price)+sum(mant)+sum(feed)) from exotic;");
l.first();
e1=l.getInt(1);
g=st.executeQuery("select sum(sell) from sellexotic;");
g.first();
e2=g.getInt(1);
e=e2-e1;

}catch(Exception e) {
System.out.println(e.getMessage());}
ex1.setText(""+e1);

51
ex2.setText(""+e2);
ex.setText(""+e);
int pc=c1+r1+e1+p1;
int pg=c2+r2+e2+p2;
totc.setText(""+pc);
tots.setText(""+pg);
int production=pg-pc;
TT.setText(""+production);
if(pc<pg)
JOptionPane.showMessageDialog(null,"Congragulation your PROFIT is"+" "+
production );
else
JOptionPane.showMessageDialog(null,"Sorry your LOSS is"+" "+ production*-1
); // TODO add your handling code here:
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
HOME w2 = new HOME();
w2.setVisible(true);
this.dispose();}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new evltable().setVisible(true);
}
})) }

52
53
54
WELCOME FORM

55
WHEN LOGIN BUTTON IS CLICKED

HOME MENU

WHEN CATTLE LABEL IS CLICKED FROM HOME MENU CLICKED

56
WHEN CONTINUE BUTTON IS CLICKED

AFTER ENTERING THE DAILY DETAILS SUMBIT BUTTON IS CLICKED


57
IN OTHER SECTION  SELLING SECTION IS CLICKED

58
SELLING DETAILS ARE ENTERED AND UPDATE BUTTON IS CLICKED

IN PRODUCTION  SUMMARY IS CLICKED

EVALUATION FRAME

59
WHEN EVALUATION CHART IS CLICKED

60
WHEN POULTRY LABEL IS CLICKED FROM HOME MENU CLICKED

WHEN CONTINUE BUTTON IS CLICKED

AFTER ENTERING THE DAILY DETAILS SUMBIT BUTTON IS CLICKED

61
IN OTHER SECTION  SELLING SECTION IS CLICKED

62
SELLING DETAILS ARE ENTERD AND UPDATE BUTTON IS CLICKED

IN PRODUCTION  SUMMARY IS CLICKED

63
EVALUATION FRAME

WHEN EVALUATION CHART IS CLICKED

64
WHEN POULTRY LABEL IS FROM HOME MENU CLICKED

WHEN CONTINUE BUTTON IS CLICKED

65
AFTER ENTERING THE DAILY DETAILS SUMBIT BUTTON IS CLICKED

IN OTHER SECTION  SELLING SECTION IS CLICKED

66
SELLING DETAILS ARE ENTERD AND UPDATE BUTTON IS CLICKED

IN PRODUCTION  SUMMARY IS CLICKED

67
EVALUATION FRAME

WHEN EVALUATION CHART IS CLICKED

68
WHEN EXOTIC LABLE IS CLICKED FROM EXOTIC

WHEN DESIERD RECORD IS SELECTED, DETAILS ARE ENTERED AND SUBMIT


BUTTON IS CLICKED

69
WHEN INSERT BUTTON IS CLICKED DETAILS ARE ENTERD AND CONFIRM
BUTTON IS CLICKED

70
WHEN BACK BUTTON IS CLICKED

IN OTHER SECTION  SELLING SECTION IS CLICKED

71
SELLING DETAILS ARE ENTERD AND UPDATE BUTTON IS CLICKED
WHEN ANIMAL NUMBER GREATER THAN ENTERED NUMBER

WHEN BACK BUTTON IS CLICKED


72
WHEN ANIMAL NUMBER EQUALS ENTERED NUMBER

73
WHEN BACK BUTTON IS CLICKED

WHEN ANIMAL NUMBER LESS THAN ENTERD NUMBER

74
IN PRODUCTION  SUMMARY IS CLICKED

75
WHEN EVALUATION CHAT IS CLICKED

WHEN OVERALL BUTTON FROM HOME MENU IS CLICKED

WHEN SUM-UP BUTTON IS CLICKED


76
77
BIBLIOGRAPHY

# www.google.com
# Informatics practices class XII,sultan
chan.
# NCERT informatic practices class 12.

78

S-ar putea să vă placă și