jQuery in Action, 3rd edition
The moose likes Linux / UNIX and the fly likes sql exception : user property is missing ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "sql exception : user property is missing ???" Watch "sql exception : user property is missing ???" New topic

sql exception : user property is missing ???

mudassir shahab
Ranch Hand

Joined: Oct 13, 2003
Posts: 54

i am using postgres on redhat 9 ...i have written a jdbc code for connection with postgres...when i run it ....it gives the following error

SQL EXCEPTION The user property is missing. It is mandatory.

the code is as follows :

import java.sql.*;

class mydb


public static void main(String [] args)

Connection dbconn ;
Statement stmt ;
ResultSet author ;
String sourceURL = "jdbc ostgresql://localhost/synergy";


dbconn = DriverManager.getConnection(sourceURL);
stmt = dbconn.createStatement();
author = stmt.executeQuery("SELECT * FROM cust_info");




stmt.close() ;


catch(ClassNotFoundException cnfe){

System.out.println("CLASS NOT FOUND EXCEPTION "+cnfe);


catch(SQLException sqle){

System.out.println("SQL EXCEPTION "+sqle);


plz solve it out.....
Nicolas Taillepied

Joined: Jul 23, 2004
Posts: 8
Hi, I hope that you've solved your problem.
If you don't, try :
dbconn = DriverManager.getConnection(sourceURL,"your user name for postgres","your password");
instead of dbconn = DriverManager.getConnection(sourceURL);
Good luck
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17030

PostgreSQL, like many modern DBMSs is designed with the idea that many users/applications will be sharing the same database(s) and that some should be allowed to do things that other aren't. A good example I saw the other day was in a financial system, where users could add transactions, but not update or remove them (in accounting, you should always add a cancelling transaction, not simply delete a bad one, so that a full audit trail is preserved).

So what a userid/password gives you is a way of attaching to a specific set of security rules. It often does other things as well, but security is one of the more important reasons.

An IDE is no substitute for an Intelligent Developer.
Have you checked out Aspose?
subject: sql exception : user property is missing ???
It's not a secret anymore!