Re: [QUESTIONS] Accessing Postgresfrom JBuilder using JDBC

From: Peter T Mount <postgresdev(at)maidast(dot)demon(dot)co(dot)uk>
To: Pierre Habraken <Pierre(dot)Habraken(at)ujf-grenoble(dot)fr>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [QUESTIONS] Accessing Postgresfrom JBuilder using JDBC
Date: 1998-03-18 19:00:32
Message-ID: Pine.LNX.3.95.980318185416.30928A-100000@maidast
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces


[ forwarding to the interfaces list ]

On Wed, 18 Mar 1998, Pierre Habraken wrote:

> I am trying to set up a connection to PostgreSql from JBuilder using the
> JDBC driver, but for now all my attempts have failed.
>
> I first compiled, tested and installed the driver on my NT 4
> workstation. Then I followed the instructions given in the JBuilder
> (Professionnal) Programming Guide:
> 1) Create a new project and a new application.
> 2) Add a Database component
> 3) Open the connection editor
> 4) Fill up the fields inside the connection editor window:
> URL Connection = jdbc:postgresql://server/database
> User Name = postgres
> Driver Class = postgresql.Driver
> and select the option 'Ask for user password'
> 5) Push down the button 'Connection test'. JBuilder pop then a message
> dialog up telling me: "no suitable driver" !

That's because the driver isn't loaded. Two ways to do this:

1) Add -Djdbc.drivers=postgresql.Driver although this won't work for
JBuilder.

2) Add something like:
Class.forName("postgresql.Driver");
to your code.

> The archive file postgresql.jar being installed in
> C:\JBuilder\myclasses, I added the path
> C:\JBuilder\myclasses\postgresql.jar to the list of default class paths,
> using the environment options editor accessed from the JBuilder menu
> 'Tools/EDI...'.
>
> I wonder what is wrong in what I am doing.
> Has anyone got successful results in trying to build a pure Java C/S
> application using JBuilder, JDBC and PosgreSql ?
>
> I would really appreciate any advice.

Can someone who's got more details for JBuilder to reply let him know, &
CC me so I can add it to the docs.

Thanks, Peter

--
Peter T Mount petermount(at)earthling(dot)net or pmount(at)maidast(dot)demon(dot)co(dot)uk
Main Homepage: http://www.demon.co.uk/finder
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter(at)maidstone(dot)gov(dot)uk

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message The Hermit Hacker 1998-03-19 04:31:16 Re: Getting it to work
Previous Message Bruce Stephens 1998-03-17 19:40:20 Re: [INTERFACES] Tix + Postgres questions.