Skip site navigation (1) Skip section navigation (2)

Problem with "/etc/alternatives/java" and "pg74.215.jdbc3.jar".

From: Vinicius <cviniciusm(at)terra(dot)com(dot)br>
To: pgsql-admin(at)postgresql(dot)org
Subject: Problem with "/etc/alternatives/java" and "pg74.215.jdbc3.jar".
Date: 2005-02-23 03:32:44
Message-ID: cvgta1$9q5$ (view raw or whole thread)
Lists: pgsql-admin

I'm trying to connect to a postgresql database through the postgresql 
jdbc driver, but appears the errors below:

"$ java TesteJDBC_PGSQL

This script is a placeholder for the /usr/bin/java
master link required by conventions.  libgcj's
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives(8) system.

This change was necessary because the rmiregistry, rmic and jar tools
installed by previous versions of libgcj conflicted with symlinks
installed by JVM packages.
Iniciando a conexao com o BD...
Exception in thread "main" java.lang.NoClassDefFoundError: while 
resolving class: org.postgresql.Driver
    at java.lang.VMClassLoader.resolveClass(java.lang.Class) 
    at java.lang.Class.initializeClass() (/usr/lib/
    at java.lang.Class.forName(java.lang.String, boolean, 
java.lang.ClassLoader) (/usr/lib/
    at java.lang.Class.forName(java.lang.String) (/usr/lib/
    at TesteJDBC_PGSQL.Conecta() (Unknown Source)
    at TesteJDBC_PGSQL.main(java.lang.String[]) (Unknown Source)
Caused by: java.lang.ClassNotFoundException: not 
found in [file:/usr/share/java/pg74.215.jdbc3.jar, file:./, core:/]

public static Connection Conecta()
	String url= "jdbc:postgresql:labprog3";
	Connection con;
		System.out.println("Iniciando a conexao com o BD...");
		con = DriverManager.getConnection (url,"","");
		System.out.println("Banco de Dados Ok e Pronto...");
		return con;

         catch(ClassNotFoundException fnf)
		System.out.println("Houve uma ClassNotFoundException: "+fnf);
		return null;
         catch(SQLException sql)
		System.out.println("Houve uma SQLException: "+sql);
		return null;

My login has permission to create databases and users and I have created 
a database called labprog3. I can use the command 'psql' with this 
database. I did set TCP/IP to true in 
/var/lib/pgsql/data/postgresql.conf, too.

I'm using the followed configuration:

Does this problem due the libgcj, please?
Should I remove the gcc-java, please?


P.S.: Does this mailing list the best place to put this type of problem?

pgsql-admin by date

Next:From: ViniciusDate: 2005-02-23 03:41:22
Subject: Re: Having problem with postgresql configuration (template1 doesn't
Previous:From: Gaetano MendolaDate: 2005-02-23 01:25:16
Subject: Re: Determining current WAL

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group