pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Dickhoff <bruno@dickhoff.de>
To: v j <jvs_a@yahoo.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: JDBC APPLET Problem
Date: Fri, 2 Feb 2001 00:32:15 +0100
Message-ID: <12045598116.20010202003215@dickhoff.de> (raw)
In-Reply-To: <20010201131610.9271.qmail@web9506.mail.yahoo.com>
References: <20010201131610.9271.qmail@web9506.mail.yahoo.com>

Hello v,

Thursday, February 01, 2001, 2:16:10 PM, you wrote:

vj>    public void start() {
vj>            try{ conn =
vj> DriverManager.getConnection("jdbc:postgresql://fmlhost.fml.t.u-tokyo.ac.jp/test","postgres","");
vj>                         stmt = conn.createStatement();                          
vj>            }

Maybe you forgot to load the driver?

Excerpt from the SUN docs:
------------------------
Loading Drivers
Loading the driver or drivers you want to use is very simple and involves just one line of code. If, for example, you want to use the JDBC-ODBC Bridge driver, the following code will load it:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Your driver documentation will give you the class name to use. For instance, if the class name is jdbc.DriverXYZ , you would load the driver with the following line of code:

Class.forName("jdbc.DriverXYZ");

You do not need to create an instance of a driver and register it with the DriverManager because calling Class.forName will do that for you automatically. If you were to create your own instance, you would be creating an unnecessary duplicate, but it would do no harm.

When you have loaded a driver, it is available for making a connection with a DBMS. 
-------------

-- 
Best regards,
 Bruno                            mailto:bruno@dickhoff.de





view thread (13+ messages)  latest in thread

Message-ID: <12045598116.20010202003215@dickhoff.de>
Permalink:  ../12045598116.20010202003215@dickhoff.de/
Also on:    postgresql.org/message-id/12045598116.20010202003215@dickhoff.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: bruno@dickhoff.de, jvs_a@yahoo.com
  Subject: Re: JDBC APPLET Problem
  In-Reply-To: <12045598116.20010202003215@dickhoff.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox