Sunday, June 10, 2018

Insert Record in Java JDBC and Oracle 11g Database

In this article I would like to share with you how to insert or add a record using Java JDBC and Oracle 11g database express edition that code is very simple and easy to understand.

I am currently accepting programming work, it project, school 

programming projects , thesis and capstone projects, IT consulting 

work and web development work kindly contact me in the following email address for further details.  If you want to advertise in my website kindly contact me also in my email address also. Thank you.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.








Sample Program Output

Program Listing

InsertRecord.java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package oraclecon;

import java.sql.*;

/**
 *
 * @author Jake Pomperada
 */
public class InsertRecord {
    public static void main(String args[])
    {
        int Id = 6;
        String Name = "JULIANNA";
        int Age=4;
        String Address ="BACOLOD";
         
        try
        {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "system", "hr");
            Statement stmt = con.createStatement();
             
            // Inserting data in database
            String q1 = "INSERT INTO hr.customers VALUES('" +Id+ "', '" +Name+ 
                                  "', '" +Age+ "', '" +Address+ "')";
            int x = stmt.executeUpdate(q1);
            if (x > 0)            
                System.out.println("Successfully Inserted");            
            else           
                System.out.println("Insert Failed");
             
            con.close();
        }
        catch(Exception e)
        {
            System.out.println(e);
        }
    }
}


Customer Listing System Using Java JDBC and Oracle Database

In this article I would like to share with you guys a program that I wrote using Java JDBC and Oracle 11g Express Edition to display the customer records from the Oracle Database. This will be my first time to use Oracle as my database to store records of the customer. I find it very challenging at first but it is very worth while in learning new database like Oracle. I hope you find it useful my sample program.  

I am currently accepting programming work, it project, school 

programming projects , thesis and capstone projects, IT consulting 

work and web development work kindly contact me in the following email address for further details.  If you want to advertise in my website kindly contact me also in my email address also. Thank you.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.







Sample Program Output

Program Listing

Oraclecon.java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


package oraclecon;


import java.sql.*;  
import java.sql.DriverManager;
import java.sql.Connection;

/**
 *
 * @author Jake R. Pomperada
 * June 10, 2018
 * Sunday, Bacolod City, Negros Occidental
 */
public class OracleCon {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       try{  
//step1 load the driver class  
Class.forName("oracle.jdbc.driver.OracleDriver");  
  
//step2 create  the connection object  
Connection con=DriverManager.getConnection(  
"jdbc:oracle:thin:@localhost:1521:xe","system","hr");  
  
//step3 create the statement object  
Statement stmt=con.createStatement();  
  
//step4 execute query  

System.out.println("CUSTOMER LISTING SYSTEM USING JAVA JDBC AND ORACLE DATABASE");
System.out.println();
System.out.println("Created By Mr. Jake R. Pomperada,MAED-IT");
System.out.println();

ResultSet rs=stmt.executeQuery("SELECT * FROM HR.CUSTOMERS ORDER BY ID ASC ");  
while(rs.next())  {
System.out.println("ID       :    "  +  rs.getInt(1));
System.out.println("Name     :    "  +  rs.getString(2));
System.out.println("Age      :    "  +  rs.getString(3));
System.out.println("Address  :    "  +  rs.getString(4));  
System.out.println(); 

  
}
System.out.println();
System.out.println("===== End of Program =====");
System.out.println(); 
//step5 close the connection object 
con.close();
}catch(Exception e){ System.out.println(e);}  
  
    }
    
}




Thursday, June 7, 2018

Color Checker in Turbo Pascal

In this article I would like to share with you a sample program that will use case conditional statement in Turbo Pascal. What the program does is to ask the user to give a letter and then our program will check and determine what is the corresponding color will be display on the screen based on the letter being given by our user. I am using Turbo Pascal for Windows in writing this simple program of ours.

I am currently accepting programming work, it project, school 

programming projects , thesis and capstone projects, IT consulting 

work and web development work kindly contact me in the following email address for further details.  If you want to advertise in my website kindly contact me also in my email address also. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.







Sample Program Output


Program Listing

color.pas

(* color.pas                                                        *)
(* Author : Mr. Jake R. Pomperada, MAED-IT                          *)
(* June 7, 2018 Thursday                                            *)
(* Eroreco Subdivision, Bacolod City, Negros Occidental Philippines *)

program ColorChecker;

uses
  WinCrt;


Var Select_Color : Char;

Begin
  Write('Color Checker in Turbo Pascal');
  Writeln;
  Write('Written By Mr. Jake R. Pomperada, MAED-IT');
  Writeln;
  Writeln;
  Write('Give a Letter : ');
  Readln(Select_Color);
  Writeln;
  Writeln;
  Case Select_Color of
     'B','b' : writeln('You have selected BLUE Color');
     'R','r' : writeln('You have selected RED Color');
     'G','g' : writeln('You have selected GREEN Color');
     'V','v' : writeln('You have selected VIOLET Color');
 Else
    Writeln('Sorry unknown color selected.');
 end;
 Writeln;
 Write('End of Program');
 Writeln;
End.

Monday, June 4, 2018

While Loop Statement in PHP

A very simple program that I wrote in PHP to demonstrate the use of while loop statement.

I am currently accepting programming work, it project, school 

programming projects , thesis and capstone projects, IT consulting 

work and web development work kindly contact me in the following email address for further details.  If you want to advertise in my website kindly contact me also in my email address also. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Sample Program Output


Program Listing

while.php

<?php 
$x = 1; 


echo "<h1> While Statement in PHP </h1>";
echo "<br>";

while($x <= 10) {
    echo "The number is: $x <br>";
    $x++;
?>

Wednesday, May 23, 2018

Sum of Five Numbers in Turbo Pascal

In this article I would like to share with you a simple program that will ask the user to give five numbers and the  our program will compute the sum of the five number being provided by our user. I am using Turbo Pascal for Windows in writing this program.

I am currently accepting programming work, it project, school 

programming projects , thesis and capstone projects, IT consulting 

work and web development work kindly contact me in the following email address for further details.  If you want to advertise in my website kindly contact me also in my email address also. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.




Sample Program Output


Program Listing

sum.pas

(* Written By: Mr. Jake R. Pomperada *)
(* May 22, 2018                      *)
(* Product of Bacolod City, Negros Occidental Philippines *)

Program SumofFive;
Uses WinCrt;

Var
  a,b,c,d,e,sum : Integer;


Begin
  Write('Sum of Five Numbers in Turbo Pascal');
  Writeln;
  Writeln;
  Write('Written By Mr. Jake R. Pomperada, MAED-IT');
  Writeln;
  Writeln;
  Write('Give Five Numbers : ');
  Readln(a,b,c,d,e);
  Writeln;
  Writeln;
  sum := (a+b+c+d+e);
  Writeln('The sum of five numbers is ',sum,'.');
  Writeln;
  Writeln('End of Program');
  Writeln;
  Readln;
End.

Uppercase Program in Turbo Pascal

Here is a very simple program that I wrote in Turbo Pascal for Windows that will ask the user to give a word or a string in all lower case letters and then it will convert it into upper case format.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details.  If you want to advertise in my website kindly contact me also in my email address also. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.





Sample Program Output


Program Listing

uppercase.pas


(* Written By: Mr. Jake R. Pomperada *)
(* May 22, 2018                      *)
Program UpperCasePascal;
Uses WinCrt;

Type

  MaxStr = String[255];

Var
  s : MaxStr;

Function UpCaseStr(s : MaxStr) : MaxStr;
Var
 i,j : Integer;
Begin
 j := ord(s[0]);

 For i := 1 to j Do
   s[i] := Upcase(s[i]);
 UpCaseStr :=s;
End;

Begin
  Write('Uppercase Program in Turbo Pascal');
  Writeln;
  Writeln;
  Write('Written By Mr. Jake R. Pomperada, MAED-IT');
  Writeln;
  Writeln;
  Write('Give a String : ');
  Readln(s);
  Writeln;
  Writeln;
  Write('The uppecase equivalent is ' ,UpcaseStr(s),'.');
  Writeln;
  Writeln;
  Writeln('End of Program');
  Writeln;
  Readln;
End.


LowerCase Program in Turbo Pascal

Here is a very simple program that I wrote in Turbo Pascal for Windows that will ask the user to give a word or a string in all capital letters and then it will convert it into lowercase.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details.  If you want to advertise in my website kindly contact me also in my email address also. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.





Sample Program Output


Program Listing

lowercase.pas

(* Written By: Mr. Jake R. Pomperada *)
(* May 22, 2018                      *)
(* Product of Bacolod City, Negros Occidental Philippines *)

Program LowerCasePascal;
Uses WinCrt,Strings;

Var
  s : Array[0..255] of Char;


Begin
  Write('LowerCase Program in Turbo Pascal');
  Writeln;
  Writeln;
  Write('Written By Mr. Jake R. Pomperada, MAED-IT');
  Writeln;
  Writeln;
  Write('Give a String : ');
  Readln(s);
  Writeln;
  Writeln;
  Write('The lowercase equivalent is ' ,StrLower(s),'.');
  Writeln;
  Writeln;
  Writeln('End of Program');
  Writeln;
  Readln;
End.