pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedcannot find org.postgres.Driver
5+ messages / 3 participants
[nested] [flat]
* cannot find org.postgres.Driver
@ 2004-05-25 22:44 Felipe <pipojmr@yahoo.com.mx>
2004-05-26 00:53 ` Re: cannot find org.postgres.Driver Dave Cramer <pg@fastcrypt.com>
2004-05-26 14:35 ` Re: cannot find org.postgres.Driver Ulrich Meis <kenobi@halifax.rwth-aachen.de>
0 siblings, 2 replies; 5+ messages in thread
From: Felipe @ 2004-05-25 22:44 UTC (permalink / raw)
To: pgsql-jdbc
Hi everybody
I'm trying to write an applet to acces postgres but when I load the applet in a web browser doesn't seems to work. In the JVM console I obtain an error that says something like this
Cannot find "/home/applets/org/postgresql/Driver"
the code I use to load the postgres driver is as follows
Class.forName("org.postgresql.Driver");
Connection db = DriverManager.getConnection("jdbc:postgresql:arl",user,password);
where arl is the database name
for you anwser thanks
---------------------------------
Do You Yahoo!?
Yahoo! Net: La mejor conexión a internet y 25MB extra a tu correo por $100 al mes.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: cannot find org.postgres.Driver
2004-05-25 22:44 cannot find org.postgres.Driver Felipe <pipojmr@yahoo.com.mx>
@ 2004-05-26 00:53 ` Dave Cramer <pg@fastcrypt.com>
1 sibling, 0 replies; 5+ messages in thread
From: Dave Cramer @ 2004-05-26 00:53 UTC (permalink / raw)
To: Felipe <pipojmr@yahoo.com.mx>; +Cc: pgsql-jdbc
Felipe,
from the http://jdbc.postgresql.org/doc.htm site
So our url? It's one of the following:
jdbc:postgresql:database
jdbc:postgresql://host/database
jdbc:postgresql://host:port/database
where database is the database to connect to, host the server to connect
to, and port the port number.
If left out, host defaults to localhost (not 127.0.0.1 see applets!) and
port to 5432 (configurable at build time).
Dave
On Tue, 2004-05-25 at 18:44, Felipe wrote:
> Hi everybody
>
> I'm trying to write an applet to acces postgres but when I load the
> applet in a web browser doesn't seems to work. In the JVM console I
> obtain an error that says something like this
>
> Cannot find "/home/applets/org/postgresql/Driver"
>
> the code I use to load the postgres driver is as follows
>
> Class.forName("org.postgresql.Driver");
> Connection db =
> DriverManager.getConnection("jdbc:postgresql:arl",user,password);
>
> where arl is the database name
>
> for you anwser thanks
>
>
>
> ______________________________________________________________________
> Do You Yahoo!?
> Yahoo! Net: La mejor conexión a internet y 25MB extra a tu correo por
> $100 al mes.
> !DSPAM:40b3cd80232576939882854!
--
Dave Cramer
519 939 0336
ICQ # 14675561
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: cannot find org.postgres.Driver
2004-05-25 22:44 cannot find org.postgres.Driver Felipe <pipojmr@yahoo.com.mx>
@ 2004-05-26 14:35 ` Ulrich Meis <kenobi@halifax.rwth-aachen.de>
2004-05-26 22:06 ` Re: cannot find org.postgres.Driver Felipe <pipojmr@yahoo.com.mx>
1 sibling, 1 reply; 5+ messages in thread
From: Ulrich Meis @ 2004-05-26 14:35 UTC (permalink / raw)
To: Felipe <pipojmr@yahoo.com.mx>; +Cc: pgsql-jdbc
Felipe wrote:
> Cannot find "/home/applets/org/postgresql/Driver"
>
Did you extract the jdbc classes or are you using the postgresql.jar file?
If you use the jar, did you mention it in the archive property of your
applet/object/embed tag?
Your html page and your directory structure would help.
Greetings,
Uli
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: cannot find org.postgres.Driver
2004-05-25 22:44 cannot find org.postgres.Driver Felipe <pipojmr@yahoo.com.mx>
2004-05-26 14:35 ` Re: cannot find org.postgres.Driver Ulrich Meis <kenobi@halifax.rwth-aachen.de>
@ 2004-05-26 22:06 ` Felipe <pipojmr@yahoo.com.mx>
2004-05-28 02:01 ` Re: cannot find org.postgres.Driver Ulrich Meis <kenobi@halifax.rwth-aachen.de>
0 siblings, 1 reply; 5+ messages in thread
From: Felipe @ 2004-05-26 22:06 UTC (permalink / raw)
To: Ulrich Meis <kenobi@halifax.rwth-aachen.de>; +Cc: pgsql-jdbc
I'm using the file pg73jdbc3.jar which is included in my classpath
well, my directory structure is:
/home/Documents/dbConnection/classes/dbconnection
here are all classes
and html file is in
/home/Documents/dbConnection/classes/
my source code is as follows
package dbconnection;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
import java.sql.*;
public class Conectame1 extends JApplet {
//Construct the applet
public Conectame() {
}
//Initialize the applet
public void init() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception, ClassNotFoundException, SQLException{
conexion esta = new conexion();
jLabel1.setText("database name: "+esta.db.getDatabaseProductName());
this.setSize(new Dimension(400,300));
this.getContentPane().add(jLabel1, BorderLayout.CENTER);
}
}
class conexion {
Connection db;
DatabaseMetaData dbmd;
public conexion() throws ClassNotFoundException, SQLException
{
Class.forName("org.postgresql.Driver");
db = DriverManager.getConnection("jdbc:postgresql:arl","pipo","jamara16");
dbmd = db.getMetaData();
}
public static void main(String[] args) throws SQLException, ClassNotFoundException
{
conexion conexion1 = new conexion();
}
}
my html code is as follows
html>
head>
title>
HTML Test Page
/title>
/head>
body>
dbconnection.Conectame will appear below in a Java enabled browser.<br>
applet
codebase = "."
code = "dbconnection.Conectame.class"
name = "TestApplet"
width = "400"
height = "300"
hspace = "0"
vspace = "0"
align = "middle"
>
/applet>
/body>
/html>
(I erased the '<' for my mail manager)
thanks for your answer
---------------------------------
Do You Yahoo!?
Yahoo! Net: La mejor conexión a internet y 25MB extra a tu correo por $100 al mes.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: cannot find org.postgres.Driver
2004-05-25 22:44 cannot find org.postgres.Driver Felipe <pipojmr@yahoo.com.mx>
2004-05-26 14:35 ` Re: cannot find org.postgres.Driver Ulrich Meis <kenobi@halifax.rwth-aachen.de>
2004-05-26 22:06 ` Re: cannot find org.postgres.Driver Felipe <pipojmr@yahoo.com.mx>
@ 2004-05-28 02:01 ` Ulrich Meis <kenobi@halifax.rwth-aachen.de>
0 siblings, 0 replies; 5+ messages in thread
From: Ulrich Meis @ 2004-05-28 02:01 UTC (permalink / raw)
To: Felipe <pipojmr@yahoo.com.mx>; +Cc: pgsql-jdbc
Felipe wrote:
> I'm using the file pg73jdbc3.jar which is included in my classpath
>
And here's the problem. Your browser uses the Java Plugin and that has a
different classpath. You can set it on your machine, but you can't set
it on everyone's machine who's going to visit your page.
You need to include the jar file in your applet tag. I am not sure if it
is possible with a plain <applet> tag, but you can try to add
codebase="pg73jdbc3.jar".
That might fail, but with JDK 1.2 applets you shouldn't use that tag
anyway. Unfortunately it depends on the browser if you need to use an
<object> or an <embed> tag, but the whole matter is best discussed here:
http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/contents.html
where you can find a solution for both major browser families out there.
Greetings,
Uli
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2004-05-28 02:01 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-05-25 22:44 cannot find org.postgres.Driver Felipe <pipojmr@yahoo.com.mx>
2004-05-26 00:53 ` Dave Cramer <pg@fastcrypt.com>
2004-05-26 14:35 ` Ulrich Meis <kenobi@halifax.rwth-aachen.de>
2004-05-26 22:06 ` Felipe <pipojmr@yahoo.com.mx>
2004-05-28 02:01 ` Ulrich Meis <kenobi@halifax.rwth-aachen.de>
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