FileDocCategorySizeDatePackage
DarwinsDataLookup.javaAPI DocExample686Sat Jan 13 18:09:52 GMT 2001None

DarwinsDataLookup

public class DarwinsDataLookup extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)


		// Find DataSource from JNDI
		System.getProperties().setProperty("java.naming.factory.initial",
			"com.sun.jndi.rmi.registry.RegistryContextFactory");
		System.getProperties().setProperty("java.naming.provider.url",
			"rmi://localhost/");
		DataSource ds =
			(DataSource)new InitialContext().lookup("darwinsys/RainData");

		// Test it out...
		Connection conn = ds.getConnection("student", "student");
		System.out.println("Connection = " + conn);
		conn.close();