A jdbc driver can be registered with the Driver Manager in four ways.
1. Automatic Registration
2. Using Class.forName("DRIVER_NAME")
3. Using property -Djdbc.drivers=DRIVER_NAME
4. Explicit registration using the new operator
Automatic Registration
Starting JDBC 4.0, the DriverManager methods getConnection() and getDrivers() have been enhanced to support automatic registration of the driver using the Service Provider mechanism.
Read more ...
Search This BlogOct 2, 2013Automatically registering the jdbc driverSep 2, 2013Find depth of the deepest odd level leaf node in a binary tree
Write a program to find maximum height of the odd level leaf node of a binary tree. The problem has been picked up from GeeksforGeeks Aug 29, 2013Find max height of a binary tree
Program for finding maximum depth or height of a binary tree /** * find height of the tree recursively */ public static int maxHeight() { return maxHeight(root, 0); } private static int maxHeight(Node node, int h) { if (node == null) { return h; } int lh = maxHeight(node.left, h + 1); int rh = maxHeight(node.right, h + 1); return (lh > rh) ? lh : rh; } Read more ... Aug 25, 2013Creating a binary search tree using iterative approach in Java
Program for creating a binary search tree using iterative method private void addNode(Node node, int n) { while (node != null) { if(n < node.data) { if(node.left != null) { node = node.left; } else { node.left = new Node(n); return; } } else if(n > node.data) { if(node.right != null) { node = node.right; } else { node.right = new Node(n); return; } } else { System.out.println("WARNING: Elements are equal"); return; } } } Read more ... Creating a binary search tree using recursion in Java
Program for creating binary search tree using recursive method private void addNode(Node node, int n) { if (n < node.data) { if (node.left != null) { addNode(node.left, n); } else { node.left = new Node(n); } } else if (n > node.data) { if (node.right != null) { addNode(node.right, n); } else { node.right = new Node(n); } } else { System.out.println("WARNING: Number exists already"); } } Read more ... Apr 7, 2013An elegant navigation menu bar using css 3
Jan 20, 2013Consuming a webservice using Apache Axis2
The post assumes one to be familiar with the steps to create and host a web service using Apache Axis2. If not, you can refer the following tutorial. Configuring Apache Axis2 Read more ... Jan 13, 2013Axis2 Web Service - A Simple tutorial using Maven
Creating a Web Service using Axis2 Read more ... Jan 12, 2013Maven - Copying artifacts to specific folderAbove is the directory structure of web application generated using maven. Use maven-dependency-plugin for copying artifacts to desired folder under WEB-INF directoryRead more ... Jan 10, 2013Dealing with cache issues in Jnlp applications
Even though I had disabled the temporary internet files setting in the java control panel as shown below, my jnlp application will still not pick up the latest changes. This is a common issue faced by java web start application developers and becomes quite annoying if changes are not getting reflected. Command for deleting Java Web Start Cache Read more ... Debugging Java Web Start / JNLP Applications
Steps for debugging a java web start jnlp application Read more ... Jan 3, 2013Deploying web applications using maven command line
<build> <finalName>webapp</finalName> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <configuration> <url>http://localhost:8080/manager/text</url> <username>admin</username> <password>admin</password> </configuration> </plugin> </plugins> </pluginManagement> </build> Read more ... Jan 1, 2013Stack implementation using a singly linked list
The below is a stack implementation using a singly linked list. package com.ds.programs; class StackNode<E> { E data; StackNode<E> next; } Read more ...
Subscribe to:
Posts
(
Atom
)
|