Heap Sort in Java

Here you will get program for heap sort in java. Heap sort is a sorting algorithm that uses heap data structure. Its best, worst and average time complexity is O (n log n).   How heap sort algorithm works? First we make max heap from given set of elements. In max heap each parent node is greater than or equal to its left and right child. Now first node is swapped by last node and size of heap is reduced by 1.

Read more

Java Web Services Tutorial

Here in this java web services tutorial you will learn about various concepts of web services and how to create web services in java.   What is Web Service? Web Services are used for communication and exchanging information between applications. In simple words, a service that is available on internet and can be invoked by client using some web protocols is called web service. Why we need Web Services? Let’s take one real life example to understand this. Suppose there

Read more

Solve java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver Error

In this tutorial you will learn to solve java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver error. If you are using jdk 1.8 and trying to connect java with MS Access database then you will get error java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver. This is because java 8 or jdk 1.8 does not support jdbc odbc bridge. To connect with ms access you have to import some libraries. How to Solve java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver Error? 1. Download jars from below link and import in the ide you are using. Link: http://www.mediafire.com/download/ahzw21rrp20qiw8/ucanaccess.rar   Also Read: How

Read more

How to Connect Java (JDBC) with MS Access Database

In this tutorial I will teach you how to connect java (jdbc) with ms access database. MS Access is a part of Microsoft Office and used as database management system (dbms). For making a new database go to MS Access > Blank Database. Give a name to database and click on Create button to create the database. Also Read: How to Connect Java (JDBC) with MySQL or Oracle Database Below example shows jdbc ms access database connectivity. How to Connect Java

Read more

Checked and Unchecked Exceptions in Java

There are two types of exceptions in Java i.e. checked and unchecked exceptions. Below I have explained about these two exceptions with examples. Checked and Unchecked Exceptions in Java Checked Exceptions Those exceptions that are checked at compilation time are called checked exceptions. Checked exception includes the classes that extend Throwable class except RuntimeException and Error. Some examples of checked exceptions are: InvocationTargetException SQLException ClassNotFoundException IOException If a method throws checked exceptions then it must handle them by try catch

Read more

How to Connect Java (JDBC) with MySQL or Oracle Database

In this tutorial you will learn how to connect java (jdbc) with mysql or oracle database. Java JDBC is an API used to connect with database and perform all database related operations.   There are few steps for connecting java with any database. 1. Register Driver Class 2. Create Connection 3. Execute Queries 4. Close Connection   1. Register Driver Class We can register driver class by passing its name in Class.forName() method.   Example:

  Driver class for Oracle: oracle.jdbc.driver.OracleDriver

Read more

How to Add or Import Jar in Eclipse Project

In this tutorial I will show you the simplest way to add or import jar in your eclipse project.   How to Add or Import Jar in Eclipse Project 1. First of all copy all the jars that you want to import.   2. Now paste them inside lib folder of your project. Web Project: For web project you can find the lib folder inside YourProjectFolder > WebContent > WEB-INF > lib. If it is not present there just create lib

Read more

Bubble Sort in Java

In this tutorial you will learn about bubble sort in Java. In bubble sort algorithm each element is compared with adjacent element and are swapped if not in correct order. It is one of the simplest but worst sorting algorithm. It is suitable for sorting small list of numbers. As bubbles come up on surface in water, in the same way the lighter or smaller elements come forward and heavier or bigger elements goes back. Below image shows how bubble

Read more
1 17 18 19 20 21