1

I am using CentOS and Postgresql as my database.

According to this thread SQL Developer can now support Postgresql. So I manage to download the requirement such as SQL Developer 4.0 and Postgresql jdbc connector.

Is there a step by step procedure how to install the jdbc connector to sql developer? I tried to follow the PostgreSQL documentation but with no luck.

I tried to extract/install the jar file using java -jar postgresql-9.3_1100.jdbc41.jar the return is no main manifest attribute in postgresql-9.3_1100.jdbc41.jar

my java version is: 1.7.0_45

Community
  • 1
  • 1
Charlesliam
  • 1,293
  • 3
  • 20
  • 36
  • It doesn't help that you tried to follow an *incredibly ancient version* of the PostgreSQL documentation. Where exactly are you getting stuck, what's giving you problems? Installing the JDBC driver? Connecting to PostgreSQL? What? – Craig Ringer Jan 10 '14 at 03:29
  • Installing the JDBC driver..so I can see that Postgresql Tab that they are talking about. – Charlesliam Jan 10 '14 at 04:18
  • I think you'll probably have to describe the steps you have taken, and at what point what happened became different to what you thought should happen. – Craig Ringer Jan 10 '14 at 06:47
  • I believe what I have done is trying to extract/install the jar files using `java -jar postgresql-9.3_1100.jdbc41.jar` the return is `no main manifest attribute in postgresql-9.3_1100.jdbc41.jar` – Charlesliam Jan 10 '14 at 07:14
  • my java --version is `1.7.0_45` – Charlesliam Jan 10 '14 at 07:14

1 Answers1

2

You can't just run a JDBC driver as if it was an executable JAR.

java -jar postgresql-9.3_1100.jdbc41.jar

will produce the error:

no main manifest attribute in postgresql-9.3_1100.jdbc41.jar

because it has no main manifest attribute in the jar. That's because you're not supposed to run it.

Install the JDBC driver, like any other JDBC driver, according to the instructions for your application. See "Oracle SQL Developer" install JDBC driver.

The above search finds instructions on installing 3rd party (non-Oracle) JDBC drivers and "Configure JDBC in Oracle JDBC driver". I strongly suggest following those instructions.

In future, please explain step by step what you've done when you're having a problem, where you get stuck, and what you expect to happen instead.

P.s. I've submitted a patch to PgJDBC so that when you try this in future, it'll give you an informative error. See https://github.com/pgjdbc/pgjdbc/pull/112

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
  • 2
    You can actually "run" the Postgres JDBC driver: `java -cp postgresql-9.3-1100.jdbc4.jar org.postgresql.util.PSQLDriverVersion` will display the driver's version. But that too has nothing to do with installing the driver –  Jan 10 '14 at 09:05
  • @a_horse_with_no_name Didn't realise that. I've just submitted a patch that adds a mainclass to the driver - it'll print the version from DriverVersion, but also some instructions. – Craig Ringer Jan 11 '14 at 05:12
  • Now I know..joe!!..joe..In the case of PostgreSQL driver, I was wrong to thought using SQL Developer> Help> Update will check for third party jdbc. The link you provided are so helpful to pass this wall. Thanks. – Charlesliam Jan 11 '14 at 09:16