Thread

  1. Loading jdbc6.5-1.2.jar via forName()

    Wayne Johnson <wdtj@yahoo.com> — 2000-12-09T22:51:45Z

    I've installed postgresql-6.5 (client, server & jdbc) on my Linux
    system.  I've copied the jdbc6.5-1.2.jar file to the directory where my
    html and application class file is located.  When the java code calls
    forName("postgresql.Driver"), it just stalls.  I even tried renaming
    jdbc6.5-1.2.jar to postgresql.jar, but that didn't seem to help either.
    
    If I extract the jar file into a postgresql directory, it seems to work.
    
    How do I get forName to load from the jar file?
    
    Thanks.
    
    
    
  2. Re: Loading jdbc6.5-1.2.jar via forName()

    Steve Waldman <swaldman@mchange.com> — 2000-12-09T23:10:01Z

    Hi. 
    
    If you are writing an application, you need to make 
    sure that the jar file is in your application's 
    CLASSPATH. Append the full path to the jar file, 
    including the jar file name itself to 
    your CLASSPATH environment variable. (The CLASSPATH
    is a list of directories and jar files under which
    a JVM will by default search for classes. Like the
    PATH variable, entries are separated from one another
    with a ':'" on UNIX platforms, ';' on Windows.)
    
    If you are writing an Applet, you need to add an
    archive attribute to the applet tag in your html,
    whose value is a path from your html file to the
    jar file. e.g.
    
    <APPLET 
        code="mypkg.MyApplet" 
        codebase="classes" 
        archive="jars/jdbc6.5-1.2.jar"
        width="150"
        height="150"
    >
    </APPLET>
    
        good luck,
          Steve
    
    
    
    On Sat, Dec 09, 2000 at 04:51:45PM -0600, Wayne Johnson wrote:
    >
    > I've installed postgresql-6.5 (client, server & jdbc) on my Linux
    > system.  I've copied the jdbc6.5-1.2.jar file to the directory where my
    > html and application class file is located.  When the java code calls
    > forName("postgresql.Driver"), it just stalls.  I even tried renaming
    > jdbc6.5-1.2.jar to postgresql.jar, but that didn't seem to help either.
    > 
    > If I extract the jar file into a postgresql directory, it seems to work.
    > 
    > How do I get forName to load from the jar file?
    > 
    > Thanks.