Wednesday , August 21 2019

Tag Archives: Java

JAVA #32 – Java application using SQL server (Part: 04)

Read More »

JAVA #32 – Java application using SQL server (Part: 03)

Submit Button Code String INTPUTQUERY = "Insert into tblUser Values('"+txtName.getText().toString()+"','"+txtEmail.getText().toString()+"','"+txtPass.getText().toString()+"',"+txtAge.getText().toString()+")"; objDB = new DBContext(); try { objDB.ExeQuery(INTPUTQUERY); } catch (ClassNotFoundException ex) { Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex); } ResetInsert(); JOptionPane.showMessageDialog(this, "Data Inserted"); Show Button Code String ShowQuery = "Select * From tblUser"; objDB = …

Read More »

JAVA #32 – Java application using SQL server (Part: 02)

Download both the files form here: Microsoft JDBC Driver 4.2 for SQL Server sqljdbc4-2.0.jar DBContext Class code: // DBContext Class package guidatainsertion; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class DBContext { String strCon = "jdbc:sqlserver://localhost;"+ "database=GUIApp;"+ "user=sa;"+ "password=123"; String strJDBC = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; public …

Read More »

JAVA #32 – Java application using SQL server (Part: 01)

  In this part we made the GUI front end of a Application.

Read More »

40 Java Keywords With Examples

1) abstract abstract keyword is used to implement the abstraction in java. A method which doesn’t have method definition must be declared as abstract and the class containing it must be declared as abstract. You can’t instantiate abstract classes. Abstract methods must be implemented in the sub classes. You can’t use abstract keyword …

Read More »

JAVA #25 – Abstract Methods in Java

Abstract Methods An abstract method is a method that is declared without an implementation (without braces, and followed by a semicolon). abstract class GraphicObject { int x, y; ... void moveTo(int newX, int newY) { ... } abstract void draw(); abstract void resize(); } Each nonabstract subclass of GraphicObject, such …

Read More »

JAVA #24 – Abstract Classes in Java

Abstract Classes An abstract class is a class that is declared abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed. abstract class GraphicObject { int x, y; ... void moveTo(int newX, int newY) { ... } void draw() { . . …

Read More »