Re: JDBC APPLET Problem

Поиск
Список
Период
Сортировка
От Bruno Dickhoff
Тема Re: JDBC APPLET Problem
Дата
Msg-id 12045598116.20010202003215@dickhoff.de
обсуждение исходный текст
Ответ на JDBC APPLET Problem  (v j <jvs_a@yahoo.com>)
Список pgsql-interfaces
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
wantto 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
wouldload 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
willdo 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




В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Adam Haberlach
Дата:
Сообщение: PHP and error reporting
Следующее
От: "S.A.Pamungkas"
Дата:
Сообщение: Re: JDBC APPLET Problem