RE: [JDBC] I can't connect

2001-03-25 Thread Wiley, Peter
Title: RE: [JDBC] I can't connect





> >         String url = "jdbc:odbc:testing";   // I also 
> tried with 
> 
> > "jdbc:postgres:testing";>
> 
> "jdbc:postgresql:testing"


I don't think so. Try


"jdbc:postgresql://computername/testing"





Re: [JDBC] I can't connect

2001-03-22 Thread Peter T Mount

Quoting Bart <[EMAIL PROTECTED]>:

> Hi, 
> 
> I installed debian 2.2r2 with _all_ the postgres-packages,  I created a
> database and via psql I can do whatever I want with the DB. Now I'm
> trying to make a connection via a Java-program. I downloaded the
> jdbc-6.5-1.2.jar file and renamed it to jdbc.jar and moved it to
> ~/jdk1.3/lib, set the CLASSPATH to ~/jdk1.3/lib and used a program,
> found in the Deitel&Deitel Java book.

It can be put anywhere, not just ~/jdk1.3/lib...

> After that, I tried to make a connection to the database I created
> (testing) and I keep getting error-messages. 
> 
> Can someone help me with this? I'm trying for 3 days now and still no
> luck.

[snip]
>   String url = "jdbc:odbc:testing";   // I also tried with 
 "jdbc:postgres:testing";>

"jdbc:postgresql:testing"

>   String username = "postgres";
>   String password = "notentered";
>   Class.forName("jdbc.Driver");

Class.forName("org.postgresql.Driver");

Peter

-- 
Peter Mount [EMAIL PROTECTED]
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [JDBC] I can't connect

2001-03-21 Thread Bart

It works.
Thanks everyone!!!

Bart

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Re: [JDBC] I can't connect

2001-03-21 Thread jlemcke



I think your url String should be
"jdbc:postgresql:testing"
and your Class.forName should be either
"org.postgresql.Driver" or "postgresql.Driver"

John L.

Quoting Bart <[EMAIL PROTECTED]>:

> Hi, 
> 
> I installed debian 2.2r2 with _all_ the postgres-packages,  I created a
> database and via psql I can do whatever I want with the DB. Now I'm
> trying to make a connection via a Java-program. I downloaded the
> jdbc-6.5-1.2.jar file and renamed it to jdbc.jar and moved it to
> ~/jdk1.3/lib, set the CLASSPATH to ~/jdk1.3/lib and used a program,
> found in the Deitel&Deitel Java book.
> After that, I tried to make a connection to the database I created
> (testing) and I keep getting error-messages. 
> 
> Can someone help me with this? I'm trying for 3 days now and still no
> luck.
> 
> Thanks,
> Bart
> 
> 
>  --- program from Deitel & Deitel ---
> 
> import java.sql.*;
> import javax.swing.*;
> import java.awt.*;
> import java.awt.event.*;
> import java.util.*;
> 
> public class TableDisplay extends JFrame
> {
>   private Connection connection;
>   private JTable table;
>   
>   public TableDisplay()
>   {
>   String url = "jdbc:odbc:testing";   // I also tried with  "jdbc:postgres:testing";>
>   String username = "postgres";
>   String password = "notentered";
> 
>   
>   try
>   {
>   Class.forName("jdbc.Driver");
>   connection = DriverManager.getConnection(url, username, 
>password);
>   }
>   catch (ClassNotFoundException cnfex)
>   {
>   System.err.println("Failed to load the JDBC/ODBC driver.");
>   cnfex.printStackTrace();
>   System.exit(1);
>   }
>   catch (SQLException sqlex)
>   {
>   System.err.println("Unable to connect to database.");
>   sqlex.printStackTrace();
>   }
> . . . . . . . . .
> 
> ---(end of
> broadcast)---
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to
> [EMAIL PROTECTED])
> 


-
This mail sent through IMP: www.netspace.net.au


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [JDBC] I can't connect

2001-03-21 Thread Bob Kline

Bart:

Try setting CLASSPATH to the path for the jar itself, not the directory
in which you placed it.

On Wed, 21 Mar 2001, Dax Duskin wrote:

> Are you running postmaster with the -i option?
> 
> Bart <[EMAIL PROTECTED]> on 03/21/2001 02:00:45 PM
> Subject:  [JDBC] I can't connect
>
> I installed debian 2.2r2 with _all_ the postgres-packages, I created
> a database and via psql I can do whatever I want with the DB. Now
> I'm trying to make a connection via a Java-program. I downloaded the
> jdbc-6.5-1.2.jar file and renamed it to jdbc.jar and moved it to
> ~/jdk1.3/lib, set the CLASSPATH to ~/jdk1.3/lib and used a program,
> found in the Deitel&Deitel Java book. After that, I tried to make a
> connection to the database I created (testing) and I keep getting
> error-messages.
> 
> Can someone help me with this? I'm trying for 3 days now and still
> no luck.

-- 
Bob Kline
mailto:[EMAIL PROTECTED]
http://www.rksystems.com


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Re: [JDBC] I can't connect

2001-03-21 Thread Dax Duskin

Are you running postmaster with the -i option?





Bart <[EMAIL PROTECTED]> on 03/21/2001 02:00:45 PM

To:   [EMAIL PROTECTED]
cc:(bcc: Dax Duskin/Evanston/ZSAssociates)

Subject:  [JDBC] I can't connect



Hi,

I installed debian 2.2r2 with _all_ the postgres-packages,  I created a database
and via psql I can do whatever I want with the DB. Now I'm trying to make a
connection via a Java-program. I downloaded the jdbc-6.5-1.2.jar file and
renamed it to jdbc.jar and moved it to ~/jdk1.3/lib, set the CLASSPATH to
~/jdk1.3/lib and used a program, found in the Deitel&Deitel Java book.
After that, I tried to make a connection to the database I created (testing) and
I keep getting error-messages.

Can someone help me with this? I'm trying for 3 days now and still no luck.

Thanks,
Bart


 --- program from Deitel & Deitel ---

import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;

public class TableDisplay extends JFrame
{
 private Connection connection;
 private JTable table;

 public TableDisplay()
 {
  String url = "jdbc:odbc:testing";   // I also tried with 
  String username = "postgres";
  String password = "notentered";


  try
  {
   Class.forName("jdbc.Driver");
   connection = DriverManager.getConnection(url, username,
password);
  }
  catch (ClassNotFoundException cnfex)
  {
   System.err.println("Failed to load the JDBC/ODBC driver.");
   cnfex.printStackTrace();
   System.exit(1);
  }
  catch (SQLException sqlex)
  {
   System.err.println("Unable to connect to database.");
   sqlex.printStackTrace();
  }
. . . . . . . . .

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

 att1.eml


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[JDBC] I can't connect

2001-03-21 Thread Bart

Hi, 

I installed debian 2.2r2 with _all_ the postgres-packages,  I created a database and 
via psql I can do whatever I want with the DB. Now I'm trying to make a connection via 
a Java-program. I downloaded the jdbc-6.5-1.2.jar file and renamed it to jdbc.jar and 
moved it to ~/jdk1.3/lib, set the CLASSPATH to ~/jdk1.3/lib and used a program, found 
in the Deitel&Deitel Java book.
After that, I tried to make a connection to the database I created (testing) and I 
keep getting error-messages. 

Can someone help me with this? I'm trying for 3 days now and still no luck.

Thanks,
Bart


 --- program from Deitel & Deitel ---

import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;

public class TableDisplay extends JFrame
{
private Connection connection;
private JTable table;

public TableDisplay()
{
String url = "jdbc:odbc:testing";   // I also tried with 
String username = "postgres";
String password = "notentered";


try
{
Class.forName("jdbc.Driver");
connection = DriverManager.getConnection(url, username, 
password);
}
catch (ClassNotFoundException cnfex)
{
System.err.println("Failed to load the JDBC/ODBC driver.");
cnfex.printStackTrace();
System.exit(1);
}
catch (SQLException sqlex)
{
System.err.println("Unable to connect to database.");
sqlex.printStackTrace();
}
. . . . . . . . .

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])