Skip to main content

Posts

Showing posts from 2010

Database Drivers and JDK specifications

On different oracle jdbc bundles. Must read: http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html#02_07 Why couldnt I understand the naming convention of jars before: ojdbc6.jar - All the classes to support basic functionality for the Thin and OCI drivers when using JDK 1.6 (JSE 6) ojdbc5.jar - All the classes to support basic functionality for the Thin and OCI drivers when using JDK 1.5 (JSE 5) classes12.jar - Classes for the Thin and OCI drivers when using a Java 1.2 or 1.3 VM. ojdbc14.jar - Same as classes12.jar except for use with Java 1.4 VMs More dependencies for OCI: libocijdbc.so (Solaris)Native library for the JDBC OCI driver. * for JDBC 8.x.x drivers, the is 8 * for JDBC 9.x.x drivers, the is 9 * for JDBC 10.x.x drivers, the is 10 * for JDBC 11.x.x drivers, the is 11 This file should be locatable via your LD_LIBRARY_PATH setting. ocijdbc.dll (Windows)Similar to above, except on Windows platforms. This file should be locatable via your %PAT

Working with Java LDAP API

import java.io.Serializable; import java.util.Hashtable; import javax.naming.Context; import javax.naming.NamingEnumeration; import javax.naming.NamingException; import javax.naming.directory.Attribute; import javax.naming.directory.Attributes; import javax.naming.directory.BasicAttributes; import javax.naming.directory.DirContext; import javax.naming.directory.InitialDirContext; import org.apache.log4j.Logger; /** * @author Kiran * */ public class LDAPInfo implements Serializable { private static Logger log = Logger .getLogger(LDAPInfo.class); private final static String CLASS_NAME = "LDAPInfo"; private static final long serialVersionUID = 19931047L; /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String userName = null; try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://dsxstage.m

Getting the Manifest Version inside a Jar File

/** * */ import java.io.File; import java.util.Map; import java.util.jar.Attributes; import java.util.jar.Attributes.Name; import java.util.jar.JarFile; import java.util.jar.Manifest; import java.util.logging.Logger; /** * @author Kiran * */ public class JarFileVersionInfoNew { /** * A logger for this class. **/ private static final Logger LOG = Logger.getLogger(JarFileVersionInfoNew.class.getName()); /** * Displays the attributes contained in the manifest of one (or * several jar files... * * @param args a list of jar file. */ public static void main(String[] args) { final String path = "C:/Documents and Settings/kkanapar/Workspaces/WSRP/liferay-portal-new/lib/global"; File folder = new File(path); File[] listOfFiles = folder.listFiles(); System.out.println("Number of files and directories in the file system You gave: " + listOfFiles.length); for (int i =

Funny Images