Profile cover photo
Profile photo
john eipe
171 followers
171 followers
About
Communities and Collections
View all
Posts

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment
Java Enum(s) tutorial
Why use enums? Checkout this answer from stackoverflow . Start with a real time scenario of using enums: package test;

import test.GradeTest.Grade;

public class GradeTest {

public enum Grade { A, B, C, D, F, INCOMPLETE };

public static void main(Str...

Post has attachment
JDBC connections using Datasource (container implementation)
Let's first try out stand-alone application. The below program will require [tomcat-installation]/bin/tomcat-juli.jar in your projects lib folder as a stand-alone java program do not have access to tomcat implementation. package com.prodapps;

import java.s...

Post has attachment
JDBC application - connections using DataSouce (framework implementation)
We could use commons-dbcp as our library of choice. package com.prodapps;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.apache.commons.dbcp.BasicDataSource;

public class PoolingD...

Post has attachment
JDBC application - (linear) connections using DataSouce (driver implementation)
Let's try to create a stand-alone application using Datasource implementation that's available within the driver. package com.prodapps;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import ...

Post has attachment
JDBC Connections using DataSource
Why DataSource and not DriverManager? Answer is simple. That's how the API evolved. Java 1.7 docs states that "The DataSource interface, new in the JDBC 2.0 API, provides another way to connect to a data source. An alternative to the DriverManager facility...
Wait while more posts are being loaded