User only on definition for all my class
<p>I need help with java class.  I am doing a project with many class that have to connect to the LDAP of my server.  In each class, I have to specify the import javax, the context to bind to the LDAP server.  There is a way to specify javax and context in only one class and on all other class call this javax and context without rewrite everyting?</p>

<p>I want to specify only one time the section import for javax, hastable and env.put for all my class:</p>

<pre><code>package ldapUserManagement;


import javax.naming.*;
import javax.naming.directory.*;

import java.util.Hashtable;
import java.util.List;

public class Usagers
{

    private static final String String = null;
    private static Context result;

    public static void main(String[] args) 
    {

    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");

    env.put(Context.PROVIDER_URL, "ldap://192.168.0.5:389/dc=java,dc=local");
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, "java\\administrator");
        env.put(Context.SECURITY_CREDENTIALS, "*password*");
        env.put("java.naming.ldap.deleteRDN", "true");  


    try {...
</code></pre>

<p>My goal is to only specify at one place the administrator credentials and javax to import</p>

<p>Thanks to reply with a clear example</p>

<p>Thanks for rapid help!</p>
