Author name: SKB

JDBC Example3

JDBC Example to show records on JTable import java.awt.*; import java.sql.*; import java.util.*; import javax.swing.*; import java.awt.event.*; import javax.swing.table.*; public class JTableDatabase { public static void main(String[] args) { Vector columnNames = new Vector(); Vector data = new Vector(); JPanel p=new JPanel(); try { Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”); Connection con = DriverManager.getConnection(“jdbc:odbc:test”); String sql = “Select * from […]

Share

JDBC Example3 Read More »

Java swing with Database connection

Here is a Java swing program to do all database operation (insert/delete/update) import javax.swing.*; import java.awt.*; import java.sql.*; import java.awt.event.*; import java.applet.*; public class JDBCAllinOne implements ActionListener { JLabel lblFname,lblLname,lblAddress,lblSalary,lblf,lbll,lbla,lbls; JLabel lblfVal,lbllVal,lblaVal,lblsVal; JTextField txtFname,txtLname,txtAddress,txtSalary; JButton btnInsert,btnUpdate,btnDelete,btnPrev,btnNext,btnClear; ResultSet rs ; public static void main(String[] args) { JDBCAllinOne obj = new JDBCAllinOne(); obj.createUI(); } private void createUI()

Share

Java swing with Database connection Read More »

JDBC Examples

JDBC or Java Data Base Connectivity – provides an interface to Relational Data Sources JDBC library provides the means for executing SQL statements to access and operate on a relational database JDBC library is implemented in the java.sql package Set of classes and interfaces that provide a uniform API for access to broad range of

Share

JDBC Examples Read More »

Java Multi Thread Example

Java Program to show Multi Threading class Ta extends Thread { public void run() { for(int i=1; i<=5; i++) { System.out.println(“A thread=” + i); } System.out.println(“Ta is over”); } } class Tb extends Thread { public void run() { for(int j=1; j<=5; j++) { System.out.println(“B thread=” + j); } System.out.println(“Tb is over”); } } class

Share

Java Multi Thread Example Read More »

Java Inheritance and packages

Java Program to display Student Marks information using Single Inheritance. import java.io.*; class Student { int rollno; String nm; } class Marks extends Student { int p, c, m, tot; Marks() { try { DataInputStream in=new DataInputStream(System.in); System.out.print(“Enter Roll No:”); rollno=Integer.parseInt(in.readLine()); System.out.print(“Enter Name:”); nm=in.readLine(); System.out.print(“Enter Phy Marks:”); p=Integer.parseInt(in.readLine()); System.out.print(“Enter Che Marks:”); c=Integer.parseInt(in.readLine()); System.out.print(“Enter Maths Marks:”);

Share

Java Inheritance and packages Read More »

Java Programs

List of Java Programs Java program – Type casting [converting from float to an integer] class Typecast { public static void main(String args[]) { float a=2.3333f; int b=10; int c=(int)a+b; System.out.println(c); } } Java Program – use of all data types. class vari { public static void main(String args[]) { int a=3; String str=”Hello World!”;

Share

Java Programs Read More »

Java

An object-oriented, a cross platform programming language. It is used to create stand-alone applications, net based programs and programs for consumer devices. Example : cellular phones, palm pilots Features of Java:- Simple – The Java designers removed a number of complex features that existed in C, such as pointer manipulation, operator overloading etc. Object-Oriented – Everything is

Share

Java Read More »

PHP Database connection

Database connections using PHP and MS Access 1. Display list of records from MS Access  database to PHP web page. (for this example you need to create a DSN from control panel, to create DSN click here) <html> <body> <h1> Connecting to Ms Access using PHP </h1> <hr> <?php $conn=odbc_connect(‘acc_php’,”,”); if (!$conn) { exit(“Connection Failed: “

Share

PHP Database connection Read More »

PHP-Login page and sessions

PHP Session Variables 1. Login page program using PHP and MySQL DB  a) first create a html page as following. <html> <body > <form method=”post” action=”userLogin.php” > <table border=”1″ > <tr> <td> <B>User-Id</B> </td> <td><input type=”text” name=”userid”> </tr> <tr> <td><B>Password</B></td> <td><input name=”password” type=”password”></input></td> </tr> <tr> <td><input type=”submit” value=”Submit”> <td><input type=”reset” value=”Reset”> </tr> </table> </form> </body>

Share

PHP-Login page and sessions Read More »

PHP-Form validation

In this tutorials, you will be able to understand how form validation are done using php syntax. Step1 : Create a file called “Validation.php” and copy the following code and paste into it. <!DOCTYPE HTML> <html> <head> <style> .error {color: #FF00FF;} </style> </head> <body> <?php $nameErr = $emailErr = $genderErr = $websiteErr = “”; $name

Share

PHP-Form validation Read More »

Share
Scroll to Top