Professional Documents
Culture Documents
JDBC Database Programming: Presented By: Mr. Angelo P. Del Rosario
JDBC Database Programming: Presented By: Mr. Angelo P. Del Rosario
JDBC Database Programming: Presented By: Mr. Angelo P. Del Rosario
Database
Programming
Presented By: Mr. Angelo P. Del Rosario
NetBeans CRUD
Application
Integrating CRUD Functionality.
Getting Started
Before we start we need to install the
following requirements:
MySQL Server
JDK (Java Development Kit)
NetBeans
MySQL Connector/J Driver
http://www.mysql.com/products/connector/
Name
studno
studlname
studfname
studage
Type
int
varchar(30)
varchar(30)
int
import java.sql.*;
conn = MySQLConnection.ConnectDB();
pst = conn.prepareStatement(strSQL);
pst.setString(1, txtsearch.getText());
rs = pst.executeQuery();
if(rs.next()) {
JOptionPane.showMessageDialog(null,"Record Found");
txtsno.setText(rs.getString("studno"));
txtlname.setText(rs.getString("lastname"));
txtfname.setText(rs.getString("firstname"));
txtage.setText(rs.getString("age"));
}else{
JOptionPane.showMessageDialog(null,"Record Not Found");
}
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
THANK YOU..