This program demonstrate , how to connect a java program to database using middle ware. this connectivity is known as type 3 connectivity and can be done using middle ware server that provides the facilities to create datasource. Here , I am using weblogic 10.3 to create datasource and accessing MySql through core java application. This application will connect to abc data source created on weblogic and get Connection from datasource. then do whatever we does on type 1 connectivity. To run this program, you have to put weblogic.jar file into class-path otherwise it will create run-time problem. Example : import javax.sql. * ; import java.sql. * ; import java.util. * ; import javax.naming. * ; class Type4Conn { public static void main ( String ar []) throws Exception { Properties p = new Properties () ; p. put ( Context .INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" ) ; p. put ( Context .PROVIDE
Future driven solutions.