MrH wrote: I suspect the module imsJDBC.jar will provide the functionality you require.
I don't think IMSJdbcDataSource is intended for use outside of WebSphere. According to its documentation
A IMSJdbcDataSource provides a mechanism to create a Connection from an object stored in the JNDI namespace.
It also states
IMSJdbcDataSource can also be created directly in an application, rather than loading it from the name space.
When I tried running something like the suggested code segment I got the following error that references a WebSphere class:
[java] Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/websphere/runtime/CustomService
[java] at java.lang.ClassLoader.defineClass1(Native Method)
[java] at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
[java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
[java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
[java] at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
[java] at com.ibm.connector2.ims.db.IMSJdbcManagedConnectionFactory.createManagedConnection(Unknown Source)
[java] at com.icbc.ibiemapps.ims.IMSJDBCSample.main(IMSJDBCSample.java:25)
The suggested code segment:
The following code snippet demonstrates how to create an IMS DataSource from an IMSJdbcManagedConnectionFactory and use it to create a Connection:
IMSJdbcManagedConnectionFactory mcf = new IMSJdbcManagedConnectionFactory();
mcf.setDatabaseViewName("MyDatabaseView");
mcf.setDRAName("IMS1");
DataSource dataSource = (DataSource)mcf.createConnectionFactory();
Connection connection = dataSource.getConnection();
So, this brings me back to the reason I'm trying to use IMSDataSource instead of IMSJdbcDataSource. It looks like IMSJdbcDataSource can't make a Type 4 connection.