Showing posts from 2013

How to Create Runtime and Checked Exception Classes - Video Tutorial

Go Back to Table of Contents of Exception Handling in Java

Difference Between Runtime and Checked Exceptions - Video Tutorial

Go Back to Table of Contents of Exception Handling in Java

How to Throw an Exception in Java - Video Tutorial

Go Back to Table of Contents of Exception Handling in Java

How to Delegate Exception Handling Using Throws Keyword in Java - Video Tutorial

Go Back to Table of Contents of Exception Handling in Java

How to Handle Exceptions in Java - Video Tutorial

Go Back to Table of Contents of Exception Handling in Java

Introduction to Exceptions in Java - Video Tutorial

Go Back to Table of Contents of Exception Handling in Java

Exception Handling in Java - Video Tutorials

Whether you are a student or professional Java developer, in depth knowledge of exception handling is something you can't ignore, weather you work in Android, Java EE, or Java desktop applications. We often need to investigate issues in our programs, sometime the exception messages clearly explains the root cause, but because of our limited knowledge, we spend very long time investigating issues. Currently, I am working on series of video tutorials on exception handling in Java. My focus is to cover the topic in-depth. The topic of each tutorial is as follow: Introduction to exceptions in Java How to handle exceptions in Java How to delegate exception handling using 'throws' keyword How to throw an exception ourself Exception class hierarchy and difference between runtime and checked exceptions How to create runtime and checked exception classes What is exception stack trace in Java The concept of exception chaining in Java Below is the link to Download Exc

Constructors in Java Classes

Following topics are covered in-depth related to Constructors in Java classes What is a constructor When it is called We can set attributes using setters, then why we need constructors How to write a constructors How to call different constructors What is constructors overloading What is empty constructor When does JVM provides empty constructor and when it do not provide How we can define our own empty constructor Download Source Here ---------------------------------------------------------------------------------------------------------- Here is the Urdu language version How do you feel about this video, share your feedback in comments !

Java Web Programming - Running Tomcat and Creating Servlet to Handle a Form

Following topics are explained with demonstration: Downloading Tomcat 6 and extracting it  Running Tomcat and accessing default page from web browser to verify the installation  Making Java web project using IntelliJ IDEA and configuring Tomcat with IntelliJ  Creating an HTML form to submit data and a Servlet to receive the data. Don't forget to maximize the video screen (see bottom-right white arrows) to view the contents in good quality.   This is my first video lecture, so don't mind if you find some mistakes, as I am just testing how to create and publish video lectures.


//STEP 1. Import required packages import java.sql.*; public class JDBCExample {     // JDBC driver name and database URL     static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";     static final String DB_URL = "jdbc:mysql://localhost:3306/students";     //  Database credentials     static final String USER = "root";     static final String PASS = "asdf";     public static void main(String[] args) {         Connection con = null;         Statement stmt = null;         try {             //STEP 2: Register JDBC driver             Class.forName(JDBC_DRIVER);             //STEP 3: Open a connection             System.out.println("Connecting to a selected database ... ");             con = DriverManager.getConnection(DB_URL, USER, PASS);             System.out.println("Connected database successfully.");             //STEP 4: Execute a query             System.out.println("Creating statement.");             stmt =

Profiling PHP Connections - Pool vs No Pool

Creating connection in efficient way is important, specifically if you are writing a consumber website that targets thousands of concurrent visitors. In this post I would share some performance statistics of creating connections using connection pool and without using connection pool. To see the performance difference, I created 100 connections without using connection pool and another 100 connections using connection pool. Here I show you the average time of creating one connection.  I repeated same process 10 times, here are the states: Time to get one connection at localhost, in milliseconds. Without Connection Pool   |   With Connection Pool                                   9.37    |    0.99       ms                                 11.06    |    1.02       ms                                 10.48    |    0.77       ms                                 10.82    |    0.81       ms                                 10.13    |    0.81       ms                                 11.49    |  

Best Web Based Mockups Creation Tool

In last few days I spent couple of hours searching and trying different mockups creations tools/solutions. Some were only desktop based, otherwise were web based by paid. I was searching for great mockup tool that must be web based and free. Why web based, I wanted to share my created mockups with my team members. Here is the tool I finally have decided to pick. Hope you would like it too.

PHP Update Form

In PHP Update Form post, I would explain how you can display an HTML form that is already filled or populated. We often need it to update some previous data. Lets first see the code, then we would move to some points that you must understand about creating update form in php: PHP Update Form // Lets assume following are the earlier values that we want to update $name='Asif'; $password = 'mypassword'; $credit_card = 'Visa'; $city = 'Lahore'; $subjects = array("Algorithms", "OOP"); $languages = array("Java", "PHP"); // To populate these values in form, we must set these some attribute of form input controls, see below ?> Update Student Info. Name Password Subjects /> Algorithms />OOP /> Data Structures Credit Card />Visa />Master Card />American Express Ci

PHP Full Form

In this post I would explain how to process a form using PHP. Before we move to PHP code, lets see how our HTML code looks like which creates the form. I have included all possible basic controls (text, checkbox, radio, option list, etc) to demonstrate how fetching values for different type of controls differ when we write PHP code. Form with all controls Student Registration Form Name Password Subjects Algorithms OOP Data Structures Credit Card Visa Master Card American Express City Lahore Karachi Islamabad Favorite Languages Java PHP Ruby C C# If you know HTML, you know there is nothing special in above file. Its just plain HTML. Notice, action value is full-form-handler.php. It means, when the user submit this form, full-form-handler.php would be executed to

PHP Form

In this post I would create a simple form in HTML (with just two input boxes) and then write PHP code to retrieve the form values a user submit using PHP. So in our sample project there are only two files: form.html form-handler.php Let see the form.html code: PHP Form First Name: Last Name: This form will generate following output: There are following points to note: The action attribute value is form-handler.php . It shows, when the form is submitted form-handler.php would process the form. Processing includes, retrieving form data and storing it somewhere if you want to. The input text boxes names are first-name and last-name . On PHP page, we would use these  names to retrieve the values user entered in the PHP form. The Server Side The form-handler.php code retrieves the both input values and display on the next page. Lets first look at the form-handler.php code. $first_name = $_REQUEST['first-name']; $last_name = $_REQUEST['l

Mobile Application Development - Equip IT Grads With What Market is Demanding

Most Pakistani universities' BSCS / BSSE / BSIT programs contain Web Engineering course. Web Engineering primarily cover concepts and lab work related to web applications development. But in last 4-5 years, the demand of mobile applications has increased exponentially. In just 4 years of Android launch, Android store is touching 6,75000 number of total apps ( September 2012), and these are increasing day by day. In only December 2012, almost 37,500 new apps were released.  Almost same  or better is the situation at Apple App Store (that hosts apps for iPhone, iPad, etc.).                                             Ref: One may argue that CS or other degree programs focus on theoretical underpinning of computer science, instead particular type of development skill. But I believe, in countries (like Pakistan), not much grads join research career, but industry. So we should skill them in something that could greatly help them in

3 Useful SMS Services by NADRA