Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

New to Glassfish with PostgreSQL

 
   Database Forums (Home) -> Java RSS
Next:  Compare two Recordsets  
Author Message
csharpdotcom

External


Since: Feb 22, 2008
Posts: 2



(Msg. 1) Posted: Fri Feb 22, 2008 3:27 am
Post subject: New to Glassfish with PostgreSQL
Archived from groups: comp>lang>java>databases (more info?)

Hi - I've been using JSF with Glassfish successfully for the last few
months, but up to now have not tried to use databases with it, which
I'm now trying for the first time. Before I try writing any code, I
wanted to test out the code in chapter 10 of "Core JavaServer Faces"
to see if database access works with my configuration, and it does
not!

I configured the server as given in the book, and specified the JNDI
name as "jdbc/mydb", and compiled the code provided, created a war
file and deployed it. Online I found a file called
"postgresql-8.3dev-601.jdbc4.jar.zip", copied it to my "/glassfish/
domains/domain1/lib/ext/" folder, as instructed and started the server
and the application. However, after starting the application and
attempting to log in on its test page, I get the "Internal Error"
message produced by the code. In checking the log at localhost:4848 I
get various error messages saying that the connection was refused,
including that I should check TCP/IP.

Could someone kindly advise me on what is going wrong, as until I can
get an example running from the book, I can't go any further. The book
says on page 466 that I first have to create a table with a few
entries, with an example given, but nothing is said as to how I can do
that.

Some help would be most appreciated.

 >> Stay informed about: New to Glassfish with PostgreSQL 
Back to top
Login to vote
Lew

External


Since: Aug 30, 2007
Posts: 57



(Msg. 2) Posted: Fri Feb 22, 2008 8:48 am
Post subject: Re: New to Glassfish with PostgreSQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

csharpdotcom wrote:
> I configured the server as given in the book, and specified the JNDI
> name as "jdbc/mydb", and compiled the code provided, created a war
> file and deployed it. Online I found a file called
> "postgresql-8.3dev-601.jdbc4.jar.zip", copied it to my "/glassfish/
> domains/domain1/lib/ext/" folder, as instructed and started the server

I just checked the PG JDBC web site download page
<http://jdbc.postgresql.org/download.html>
and find no '.zip' files, only '.jar' files. The only zipped (actually,
GZIPped) file I see is the source distribution; presumably you only downloaded
the binary distribution.

In any event, make sure that it is a JAR file in your path. You might use a
ZIP program to view the contents to make sure that it is a proper JAR file
that you downloaded.

--
Lew

 >> Stay informed about: New to Glassfish with PostgreSQL 
Back to top
Login to vote
csharpdotcom

External


Since: Feb 22, 2008
Posts: 2



(Msg. 3) Posted: Fri Feb 22, 2008 11:41 am
Post subject: Re: New to Glassfish with PostgreSQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 22 Feb, 14:48, Lew wrote:
> csharpdotcom wrote:
> > I configured the server as given in the book, and specified the JNDI
> > name as "jdbc/mydb", and compiled the code provided, created a war
> > file and deployed it. Online I found a file called
> > "postgresql-8.3dev-601.jdbc4.jar.zip", copied it to my "/glassfish/
> > domains/domain1/lib/ext/" folder, as instructed and started the server
>
> I just checked the PG JDBC web site download page
> <http://jdbc.postgresql.org/download.html>
> and find no '.zip' files, only '.jar' files. The only zipped (actually,
> GZIPped) file I see is the source distribution; presumably you only downloaded
> the binary distribution.
>
> In any event, make sure that it is a JAR file in your path. You might use a
> ZIP program to view the contents to make sure that it is a proper JAR file
> that you downloaded.
>
> --
> Lew

Thanks, well in fact I had downloaded the zipped file mentioned above
and unzipped it. Anyway, I've replaced it with
postgresql-8.3-603.jdbc4.jar from the link you gave, and put it in my
glassfish/domains/domain1/lib/ext/ directory, but I still don't know
how to go from there and get the first example in chapter 10 of Geary
and Horstmann "Core JavaServer Faces" to work. There is some
configuration I'm just not familiar with, as I'm new to this.
Incidentally I'm running Ubunto Linux.

Christopher
 >> Stay informed about: New to Glassfish with PostgreSQL 
Back to top
Login to vote
Lew

External


Since: Aug 30, 2007
Posts: 57



(Msg. 4) Posted: Fri Feb 22, 2008 6:42 pm
Post subject: Re: New to Glassfish with PostgreSQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

csharpdotcom wrote:
> Thanks, well in fact I had downloaded the zipped file mentioned above
> and unzipped it. Anyway, I've replaced it with
> postgresql-8.3-603.jdbc4.jar from the link you gave, and put it in my
> glassfish/domains/domain1/lib/ext/ directory, but I still don't know
> how to go from there and get the first example in chapter 10 of Geary
> and Horstmann "Core JavaServer Faces" to work. There is some
> configuration I'm just not familiar with, as I'm new to this.
> Incidentally I'm running Ubunto Linux.

In my Glassfish installation I have the PG JDBC driver installed in

$GLASSFISH_HOME/domains/$USER/lib/postgresql-8.x-nnn.jdbc4.jar

no 'ext/'

I configure my datasources via http://localhost:xxxx/, where xxxx is the
'admin console' port.

--
Lew
 >> Stay informed about: New to Glassfish with PostgreSQL 
Back to top
Login to vote
Silvio Bierman

External


Since: Sep 27, 2007
Posts: 10



(Msg. 5) Posted: Sat Feb 23, 2008 8:01 am
Post subject: Re: New to Glassfish with PostgreSQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

csharpdotcom wrote:
> Hi - I've been using JSF with Glassfish successfully for the last few
> months, but up to now have not tried to use databases with it, which
> I'm now trying for the first time. Before I try writing any code, I
> wanted to test out the code in chapter 10 of "Core JavaServer Faces"
> to see if database access works with my configuration, and it does
> not!
>
> I configured the server as given in the book, and specified the JNDI
> name as "jdbc/mydb", and compiled the code provided, created a war
> file and deployed it. Online I found a file called
> "postgresql-8.3dev-601.jdbc4.jar.zip", copied it to my "/glassfish/
> domains/domain1/lib/ext/" folder, as instructed and started the server
> and the application. However, after starting the application and
> attempting to log in on its test page, I get the "Internal Error"
> message produced by the code. In checking the log at localhost:4848 I
> get various error messages saying that the connection was refused,
> including that I should check TCP/IP.
>
> Could someone kindly advise me on what is going wrong, as until I can
> get an example running from the book, I can't go any further. The book
> says on page 466 that I first have to create a table with a few
> entries, with an example given, but nothing is said as to how I can do
> that.
>
> Some help would be most appreciated.

The error seems to indicate that there is nothing wrong with your JDBC
driver but it just can't connect to a PostgreSQL database server. Is
that up and running and did you configure the correct JDBC connection URL?

Regards,

Silvio Bierman
 >> Stay informed about: New to Glassfish with PostgreSQL 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Advise on mapping JTable to large PostgreSQL table request.. - Hi, I *must* (as in: I have no choice and it can't be solved another way by customer demand) display a large table (> 1.100.000 records) in a JTable ( or something that looks like a JTable for the customer). The customer wants to able to search th...

2nd Globals Programming Challenge - USD $3,500 Grand Prize.. - Want to show how good you are at coding "Big Data" solutions? InterSystems Corp. is hosting a series of programming challenges in the Globals Community. Our 2nd Globals Challenge kicks off with a two day competition on Friday, December 02, 20...

algorithm for generating top fuzzy variations ... - Hello all, I am interested in obtaining the top N fuzzy variations of an string (a person or company name) using the same concept as the Levenshtein distance. Ussually Levenshtein is used to compute the distance between two given strings ... but I would...

Bug in Oracle org.w3c.dom.Node ? - Hello, I am using Oracle 10g for retrieving XML documents as XMLType and manipulate them in Java, using the method org.w3c.dom.Node.setTextContent() to set the text child node of a DOM node. The oracle DOM implementation just appends a child node to the...

JDBC vs SQLXML - Hi, I am writing an application in java which will write lots of data in database (i m using ms-sqlsqever) I want to know which approach is faster 1. JDBC "Batch Updates" OR 2. SQLXML BulkLoad. (Also if anybody can tell how to use SQLXML...
   Database Forums (Home) -> Java All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]