pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC Connection Problem
18+ messages / 9 participants
[nested] [flat]

* JDBC Connection Problem
@ 2001-01-31 05:09  v j <jvs_a@yahoo.com>
  0 siblings, 1 reply; 18+ messages in thread

From: v j @ 2001-01-31 05:09 UTC (permalink / raw)
  To: pgsql-interfaces@postgresql.org

Dear Sir,
I try to run the Java Program by using JDBC
PostgreSql. It can run under
only
/usr/local/pgsql/src/src/interfaces/jdbc  but it can't
run under other directories ... 
How should I do ? Plese advice me for this problem

Thanks you
J. V.

__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC Connection Problem
@ 2001-01-31 08:30  Peter T Mount <peter@retep.org.uk>
  parent: v j <jvs_a@yahoo.com>
  0 siblings, 0 replies; 18+ messages in thread

From: Peter T Mount @ 2001-01-31 08:30 UTC (permalink / raw)
  To: v j <jvs_a@yahoo.com>; +Cc: pgsql-interfaces@postgresql.org; pgsql-jdbc

Quoting v j <jvs_a@yahoo.com>:

redirected to the jdbc list:

> Dear Sir,
> I try to run the Java Program by using JDBC
> PostgreSql. It can run under
> only
> /usr/local/pgsql/src/src/interfaces/jdbc  but it can't
> run under other directories ... 

Yes it can, as long as you put it into your CLASSPATH.

ie, when built, you should find a file called postgresql.jar (named differently 
if you download from the websites).

Say you copy it into say, /usr/local/lib. Then add the jar file to the 
classpath, ie:

CLASSPATH=/usr/local/lib/postgresql.jar:$CLASSPATH

Then when your application loads the driver, it will get it from that location.

Peter

-- 
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* jdbc connection problem
@ 2007-02-01 14:46  david@mediagonal.ch
  0 siblings, 1 reply; 18+ messages in thread

From: david@mediagonal.ch @ 2007-02-01 14:46 UTC (permalink / raw)
  To: pgsql-jdbc

hi everybody,

i have a problem connecting to postgres using the jdbc driver.

took the org.postgresql.test.jdbc2.DriverTest and modified it to use 

	String url = "jdbc:postgresql://localhost/testdb";
	String user = "username";
	String pass = "password";


i get the exception 
org.postgresql.util.PSQLException: Connection Refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

however, using 
psql -h localhost -U username -W 
and then specifying the password works. so i do not see how this could be a general problem with postgresql listening on the wrong interface or not accepting connections from the local host.

btw, i use psql 8.1.4 on ubuntu, jdbc is postgresql-8.1-408.jdbc2.jar

any ideas?

thanks,
david




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: jdbc connection problem
@ 2007-02-01 17:33  Kris Jurka <books@ejurka.com>
  parent: david@mediagonal.ch
  0 siblings, 1 reply; 18+ messages in thread

From: Kris Jurka @ 2007-02-01 17:33 UTC (permalink / raw)
  To: david@mediagonal.ch; +Cc: pgsql-jdbc



On Thu, 1 Feb 2007, david@mediagonal.ch wrote:

> i have a problem connecting to postgres using the jdbc driver.
>
> 	String url = "jdbc:postgresql://localhost/testdb";
> 	String user = "username";
> 	String pass = "password";
>
>
> i get the exception org.postgresql.util.PSQLException: Connection 
> Refused. Check that the hostname and port are correct and that the 
> postmaster is accepting TCP/IP connections.
>
> however, using psql -h localhost -U username -W and then specifying the 
> password works. so i do not see how this could be a general problem with 
> postgresql listening on the wrong interface or not accepting connections 
> from the local host.
>
> btw, i use psql 8.1.4 on ubuntu, jdbc is postgresql-8.1-408.jdbc2.jar
>

Debian variants often have multiple servers installed on multiple ports. 
Try adding explicit port numbers to both psql and jdbc connections to 
ensure that you're getting the same thing.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: jdbc connection problem
@ 2007-02-02 10:30  David Buchmann <david@mediagonal.ch>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 18+ messages in thread

From: David Buchmann @ 2007-02-02 10:30 UTC (permalink / raw)
  To: pgsql-jdbc

thanks a lot. Ubuntu 6.10 sets the port to 5433 instead of 5432.
psql seems to consider this when not specifying a port - jdbc not.

i changed the port setting in /etc/postgresql/8.1/main/postgresql.conf 
to 5432 and stopped postgres and started it new. now jdbc gets the 
connection.

(restart / reload did not change the port.)


Kris Jurka wrote:
> 
> 
> Debian variants often have multiple servers installed on multiple ports. 
> Try adding explicit port numbers to both psql and jdbc connections to 
> ensure that you're getting the same thing.
> 
> Kris Jurka
> 
> On Thu, 1 Feb 2007, david@mediagonal.ch wrote:
> 
>> i have a problem connecting to postgres using the jdbc driver.
>>
>>     String url = "jdbc:postgresql://localhost/testdb";
>>     String user = "username";
>>     String pass = "password";
>>
>>
>> i get the exception org.postgresql.util.PSQLException: Connection 
>> Refused. Check that the hostname and port are correct and that the 
>> postmaster is accepting TCP/IP connections.
>>
>> however, using psql -h localhost -U username -W and then specifying 
>> the password works. so i do not see how this could be a general 
>> problem with postgresql listening on the wrong interface or not 
>> accepting connections from the local host.
>>
>> btw, i use psql 8.1.4 on ubuntu, jdbc is postgresql-8.1-408.jdbc2.jar
>>





^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* JDBC connection problem
@ 2008-02-05 03:18  Brian Tomaszewski <brianbanjo@gmail.com>
  0 siblings, 1 reply; 18+ messages in thread

From: Brian Tomaszewski @ 2008-02-05 03:18 UTC (permalink / raw)
  To: pgsql-jdbc

Hello List

I am having trouble connecting to a psql database running on  Debian
GNU/Linux system

The version of psql I am using in the system is 8.2.6.

No matter what I do, I continually am getting the error:

*Backend start-up failed: FATAL:  database "RW_GEO" does not exist

*when my JDBC component tries to connect using a URL like this:

jdbc:postgresql://localhost:5432/RW_GEO

from a tomcat app

I have confirmed that the database RW_GEO does in fact exist as I can
see/query tables from it from psql.

Also, when I run my app on my development machine (windows), I can connect
via tomcat with no problems to my local psql server.

Does any one have any ideas on what is causing the connection to not see the
database that  does in fact exist?

I am thinking that perhaps it is a permission error with tomcat, but am not
sure...

Any advice, or things to investigate would be most appreciated.

Thank you

Brian

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 06:05  Guy Rouillier <guyr-ml1@burntmail.com>
  parent: Brian Tomaszewski <brianbanjo@gmail.com>
  0 siblings, 2 replies; 18+ messages in thread

From: Guy Rouillier @ 2008-02-05 06:05 UTC (permalink / raw)
  To: pgsql-jdbc

Brian Tomaszewski wrote:
> I am having trouble connecting to a psql database running on  Debian 
> GNU/Linux system
> 
> The version of psql I am using in the system is 8.2.6.
> 
> No matter what I do, I continually am getting the error:
> 
> /Backend start-up failed: FATAL:  database "RW_GEO" does not exist
> 
> /when my JDBC component tries to connect using a URL like this:
> 
> jdbc:postgresql://localhost:5432/RW_GEO
> 
> from a tomcat app
> 
> I have confirmed that the database RW_GEO does in fact exist as I can 
> see/query tables from it from psql.
> 
> Also, when I run my app on my development machine (windows), I can 
> connect via tomcat with no problems to my local psql server.

I'm trying to follow your runtime environment, but some pieces are 
missing.  When you say you can query the database running on Debian 
using psql, is that psql running on your Windows box or on the Debian 
box?  I don't think this has anything to do with JDBC.  The URL you show 
above has "localhost" as the server for the DB.  That's probably not 
right, is it?  I wouldn't think you'd have Tomcat running on your 
database server.

So, run psql from whatever box is running Tomcat, and figure out how to 
connect it to your DB server.  Once you've done that, you should be able 
to just transfer the connection settings to JDBC.  I'm anticipating once 
you attempt to do that, you'll encounter a connection error.  That's 
because you need to update pg_hba.conf to allow access to your database 
from remote hosts.

-- 
Guy Rouillier



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 11:29  Dave Cramer <pg@fastcrypt.com>
  parent: Guy Rouillier <guyr-ml1@burntmail.com>
  1 sibling, 1 reply; 18+ messages in thread

From: Dave Cramer @ 2008-02-05 11:29 UTC (permalink / raw)
  To: Guy Rouillier <guyr-ml1@burntmail.com>; +Cc: pgsql-jdbc

Brian,

Try using lower case for the name of your database.

Postgresql and upper case is an impedance mismatch.

Dave
On 5-Feb-08, at 1:05 AM, Guy Rouillier wrote:

> Brian Tomaszewski wrote:
>> I am having trouble connecting to a psql database running on   
>> Debian GNU/Linux system
>> The version of psql I am using in the system is 8.2.6.
>> No matter what I do, I continually am getting the error:
>> /Backend start-up failed: FATAL:  database "RW_GEO" does not exist
>> /when my JDBC component tries to connect using a URL like this:
>> jdbc:postgresql://localhost:5432/RW_GEO
>> from a tomcat app
>> I have confirmed that the database RW_GEO does in fact exist as I  
>> can see/query tables from it from psql.
>> Also, when I run my app on my development machine (windows), I can  
>> connect via tomcat with no problems to my local psql server.
>
> I'm trying to follow your runtime environment, but some pieces are  
> missing.  When you say you can query the database running on Debian  
> using psql, is that psql running on your Windows box or on the  
> Debian box?  I don't think this has anything to do with JDBC.  The  
> URL you show above has "localhost" as the server for the DB.  That's  
> probably not right, is it?  I wouldn't think you'd have Tomcat  
> running on your database server.
>
> So, run psql from whatever box is running Tomcat, and figure out how  
> to connect it to your DB server.  Once you've done that, you should  
> be able to just transfer the connection settings to JDBC.  I'm  
> anticipating once you attempt to do that, you'll encounter a  
> connection error.  That's because you need to update pg_hba.conf to  
> allow access to your database from remote hosts.
>
> -- 
> Guy Rouillier
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
>               http://www.postgresql.org/about/donate




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 13:17  Brian Tomaszewski <brianbanjo@gmail.com>
  parent: Guy Rouillier <guyr-ml1@burntmail.com>
  1 sibling, 1 reply; 18+ messages in thread

From: Brian Tomaszewski @ 2008-02-05 13:17 UTC (permalink / raw)
  To: Guy Rouillier <guyr-ml1@burntmail.com>; +Cc: pgsql-jdbc

Guy,

Thanks for the response. See below for clarifications:

On Feb 5, 2008 1:05 AM, Guy Rouillier <guyr-ml1@burntmail.com> wrote:

> Brian Tomaszewski wrote:
> > I am having trouble connecting to a psql database running on  Debian
> > GNU/Linux system
> >
> > The version of psql I am using in the system is 8.2.6.
> >
> > No matter what I do, I continually am getting the error:
> >
> > /Backend start-up failed: FATAL:  database "RW_GEO" does not exist
> >
> > /when my JDBC component tries to connect using a URL like this:
> >
> > jdbc:postgresql://localhost:5432/RW_GEO
> >
> > from a tomcat app
> >
> > I have confirmed that the database RW_GEO does in fact exist as I can
> > see/query tables from it from psql.
> >
> > Also, when I run my app on my development machine (windows), I can
> > connect via tomcat with no problems to my local psql server.
>
> I'm trying to follow your runtime environment, but some pieces are
> missing.  When you say you can query the database running on Debian
> using psql, is that psql running on your Windows box or on the Debian
> box?


I can run psql (the command line tool) on Debian and using the psql tool on
Debian see/query the database that is always being reported as not existing
when the app connects.

On my Windows box, I use pgAdmin interface. I also develop the Java Code for
the app on windows and then upload it to the server to run/tes. Also, I
built the inital database on the windows box, and then uploaded and restored
it to the debian postgres running there




>  I don't think this has anything to do with JDBC.  The URL you show
> above has "localhost" as the server for the DB.  That's probably not
> right, is it?  I wouldn't think you'd have Tomcat running on your
> database server.


yes, we do have tomcat running on the database server (i.e the debian
server), is that a bad thing?

My thought with using localhost on the debain is that is that is how the
tomcat could easily connect


So, run psql from whatever box is running Tomcat, and figure out how to
> connect it to your DB server.


I have done this on windows. Every thing for my app on windows is on the
same box (tomcat, postgres etc). When I port the app up to the debian
server, the connection fails



> Once you've done that, you should be able
> to just transfer the connection settings to JDBC.  I'm anticipating once
> you attempt to do that, you'll encounter a connection error.  That's
> because you need to update pg_hba.conf to allow access to your database
> from remote hosts.
>


Ok, so is the real issue then having tomcat and postgres on the same server?
Should they be physically separate? If they are not, what do you need to
consider in terms of configuration

Thank you for your time

Brian


>
> --
> Guy Rouillier
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
>                http://www.postgresql.org/about/donate
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 13:18  Brian Tomaszewski <brianbanjo@gmail.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 18+ messages in thread

From: Brian Tomaszewski @ 2008-02-05 13:18 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Guy Rouillier <guyr-ml1@burntmail.com>; pgsql-jdbc

Dave,

Thanks for the tip. I just tried a test with a lowercase db and the
connection still didn't work.

Thanks again

BT

On Feb 5, 2008 6:29 AM, Dave Cramer <pg@fastcrypt.com> wrote:

> Brian,
>
> Try using lower case for the name of your database.
>
> Postgresql and upper case is an impedance mismatch.
>
> Dave
> On 5-Feb-08, at 1:05 AM, Guy Rouillier wrote:
>
> > Brian Tomaszewski wrote:
> >> I am having trouble connecting to a psql database running on
> >> Debian GNU/Linux system
> >> The version of psql I am using in the system is 8.2.6.
> >> No matter what I do, I continually am getting the error:
> >> /Backend start-up failed: FATAL:  database "RW_GEO" does not exist
> >> /when my JDBC component tries to connect using a URL like this:
> >> jdbc:postgresql://localhost:5432/RW_GEO
> >> from a tomcat app
> >> I have confirmed that the database RW_GEO does in fact exist as I
> >> can see/query tables from it from psql.
> >> Also, when I run my app on my development machine (windows), I can
> >> connect via tomcat with no problems to my local psql server.
> >
> > I'm trying to follow your runtime environment, but some pieces are
> > missing.  When you say you can query the database running on Debian
> > using psql, is that psql running on your Windows box or on the
> > Debian box?  I don't think this has anything to do with JDBC.  The
> > URL you show above has "localhost" as the server for the DB.  That's
> > probably not right, is it?  I wouldn't think you'd have Tomcat
> > running on your database server.
> >
> > So, run psql from whatever box is running Tomcat, and figure out how
> > to connect it to your DB server.  Once you've done that, you should
> > be able to just transfer the connection settings to JDBC.  I'm
> > anticipating once you attempt to do that, you'll encounter a
> > connection error.  That's because you need to update pg_hba.conf to
> > allow access to your database from remote hosts.
> >
> > --
> > Guy Rouillier
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 7: You can help support the PostgreSQL project by donating at
> >
> >               http://www.postgresql.org/about/donate
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 13:47  Dave Cramer <pg@fastcrypt.com>
  parent: Brian Tomaszewski <brianbanjo@gmail.com>
  0 siblings, 1 reply; 18+ messages in thread

From: Dave Cramer @ 2008-02-05 13:47 UTC (permalink / raw)
  To: Brian Tomaszewski <brianbanjo@gmail.com>; +Cc: Guy Rouillier <guyr-ml1@burntmail.com>; pgsql-jdbc

Brian,

I have no idea why you can't connect but I have comments about running  
tomcat and pg below

write a very small program which attempts to connect outside of tomcat

ie

main
class.forName("org.postgresql.Driver")
Driver.getConnection(....

and see if that connects

see below for more comments
On 5-Feb-08, at 8:17 AM, Brian Tomaszewski wrote:

> Guy,
>
> Thanks for the response. See below for clarifications:
>
> On Feb 5, 2008 1:05 AM, Guy Rouillier <guyr-ml1@burntmail.com> wrote:
> Brian Tomaszewski wrote:
> > I am having trouble connecting to a psql database running on  Debian
> > GNU/Linux system
> >
> > The version of psql I am using in the system is 8.2.6.
> >
> > No matter what I do, I continually am getting the error:
> >
> > /Backend start-up failed: FATAL:  database "RW_GEO" does not exist
> >
> > /when my JDBC component tries to connect using a URL like this:
> >
> > jdbc:postgresql://localhost:5432/RW_GEO
> >
> > from a tomcat app
> >
> > I have confirmed that the database RW_GEO does in fact exist as I  
> can
> > see/query tables from it from psql.
> >
> > Also, when I run my app on my development machine (windows), I can
> > connect via tomcat with no problems to my local psql server.
>
> I'm trying to follow your runtime environment, but some pieces are
> missing.  When you say you can query the database running on Debian
> using psql, is that psql running on your Windows box or on the Debian
> box?
>
> I can run psql (the command line tool) on Debian and using the psql  
> tool on Debian see/query the database that is always being reported  
> as not existing when the app connects.
>
> On my Windows box, I use pgAdmin interface. I also develop the Java  
> Code for the app on windows and then upload it to the server to run/ 
> tes. Also, I built the inital database on the windows box, and then  
> uploaded and restored it to the debian postgres running there
>
>
>
>  I don't think this has anything to do with JDBC.  The URL you show
> above has "localhost" as the server for the DB.  That's probably not
> right, is it?  I wouldn't think you'd have Tomcat running on your
> database server.
>
> yes, we do have tomcat running on the database server (i.e the  
> debian server), is that a bad thing?
It's not good, since tomcat and postgresql both like memory. However  
you may not have a choice.

>
>
> My thought with using localhost on the debain is that is that is how  
> the tomcat could easily connect
>
>
> So, run psql from whatever box is running Tomcat, and figure out how  
> to
> connect it to your DB server.
>
> I have done this on windows. Every thing for my app on windows is on  
> the same box (tomcat, postgres etc). When I port the app up to the  
> debian server, the connection fails
>
>
> Once you've done that, you should be able
> to just transfer the connection settings to JDBC.  I'm anticipating  
> once
> you attempt to do that, you'll encounter a connection error.  That's
> because you need to update pg_hba.conf to allow access to your  
> database
> from remote hosts.
>
>
> Ok, so is the real issue then having tomcat and postgres on the same  
> server? Should they be physically separate? If they are not, what do  
> you need to consider in terms of configuration
>
No, it's no real issue, other than a resource sharing problem.

Dave
> Thank you for your time
>
> Brian
>
>
> --
> Guy Rouillier
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
>                http://www.postgresql.org/about/donate
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 14:31  Brian Tomaszewski <brianbanjo@gmail.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 18+ messages in thread

From: Brian Tomaszewski @ 2008-02-05 14:31 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Guy Rouillier <guyr-ml1@burntmail.com>; pgsql-jdbc

Dave,

Thanks for the quick reply.

I am using java code like what you show to connect to postresql in my app

And that's part of the weird thing - java connect code with postgres
database on windows is fine, same java code trying to connect to to a
postgres database  on debian, can't connect or even see the database for
that matter

Could it be a driver version issue?

Thanks again for your time

Brian



On Feb 5, 2008 8:47 AM, Dave Cramer <pg@fastcrypt.com> wrote:

> Brian,
> I have no idea why you can't connect but I have comments about running
> tomcat and pg below
>
> write a very small program which attempts to connect outside of tomcat
>
> ie
>
> main
> class.forName("org.postgresql.Driver")
> Driver.getConnection(....
>
> and see if that connects
>
> see below for more comments
> On 5-Feb-08, at 8:17 AM, Brian Tomaszewski wrote:
>
> Guy,
>
> Thanks for the response. See below for clarifications:
>
> On Feb 5, 2008 1:05 AM, Guy Rouillier <guyr-ml1@burntmail.com> wrote:
>
> > Brian Tomaszewski wrote:
> > > I am having trouble connecting to a psql database running on  Debian
> > > GNU/Linux system
> > >
> > > The version of psql I am using in the system is 8.2.6.
> > >
> > > No matter what I do, I continually am getting the error:
> > >
> > > /Backend start-up failed: FATAL:  database "RW_GEO" does not exist
> > >
> > > /when my JDBC component tries to connect using a URL like this:
> > >
> > > jdbc:postgresql://localhost:5432/RW_GEO
> > >
> > > from a tomcat app
> > >
> > > I have confirmed that the database RW_GEO does in fact exist as I can
> > > see/query tables from it from psql.
> > >
> > > Also, when I run my app on my development machine (windows), I can
> > > connect via tomcat with no problems to my local psql server.
> >
> > I'm trying to follow your runtime environment, but some pieces are
> > missing.  When you say you can query the database running on Debian
> > using psql, is that psql running on your Windows box or on the Debian
> > box?
>
>
> I can run psql (the command line tool) on Debian and using the psql tool
> on Debian see/query the database that is always being reported as not
> existing when the app connects.
>
> On my Windows box, I use pgAdmin interface. I also develop the Java Code
> for the app on windows and then upload it to the server to run/tes. Also, I
> built the inital database on the windows box, and then uploaded and restored
> it to the debian postgres running there
>
>
>
>
> >  I don't think this has anything to do with JDBC.  The URL you show
> > above has "localhost" as the server for the DB.  That's probably not
> > right, is it?  I wouldn't think you'd have Tomcat running on your
> > database server.
>
>
> yes, we do have tomcat running on the database server (i.e the debian
> server), is that a bad thing?
>
> It's not good, since tomcat and postgresql both like memory. However you
> may not have a choice.
>
>
>
> My thought with using localhost on the debain is that is that is how the
> tomcat could easily connect
>
>
> So, run psql from whatever box is running Tomcat, and figure out how to
> > connect it to your DB server.
>
>
> I have done this on windows. Every thing for my app on windows is on the
> same box (tomcat, postgres etc). When I port the app up to the debian
> server, the connection fails
>
>
>
> > Once you've done that, you should be able
> > to just transfer the connection settings to JDBC.  I'm anticipating once
> > you attempt to do that, you'll encounter a connection error.  That's
> > because you need to update pg_hba.conf to allow access to your database
> > from remote hosts.
> >
>
>
> Ok, so is the real issue then having tomcat and postgres on the same
> server? Should they be physically separate? If they are not, what do you
> need to consider in terms of configuration
>
> No, it's no real issue, other than a resource sharing problem.
>
> Dave
>
> Thank you for your time
>
> Brian
>
>
> >
> > --
> > Guy Rouillier
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 7: You can help support the PostgreSQL project by donating at
> >
> >                http://www.postgresql.org/about/donate
> >
>
>
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 15:39  Dave Cramer <pg@fastcrypt.com>
  parent: Brian Tomaszewski <brianbanjo@gmail.com>
  0 siblings, 1 reply; 18+ messages in thread

From: Dave Cramer @ 2008-02-05 15:39 UTC (permalink / raw)
  To: Brian Tomaszewski <brianbanjo@gmail.com>; +Cc: Guy Rouillier <guyr-ml1@burntmail.com>; pgsql-jdbc

Brian,

So to be clear you are using jdbc:postgresql://localhost:5432/dbname

on both your windows box and your linux box.

Both machines have copies of the database locally ?

what does the output of psql -l show on the debian box, and is it  
listening on a tcpip port ?

Dave
On 5-Feb-08, at 9:31 AM, Brian Tomaszewski wrote:

> Dave,
>
> Thanks for the quick reply.
>
> I am using java code like what you show to connect to postresql in  
> my app
>
> And that's part of the weird thing - java connect code with postgres  
> database on windows is fine, same java code trying to connect to to  
> a postgres database  on debian, can't connect or even see the  
> database for that matter
>
> Could it be a driver version issue?
>
> Thanks again for your time
>
> Brian
>
>
>
> On Feb 5, 2008 8:47 AM, Dave Cramer <pg@fastcrypt.com> wrote:
> Brian,
>
> I have no idea why you can't connect but I have comments about  
> running tomcat and pg below
>
> write a very small program which attempts to connect outside of tomcat
>
> ie
>
> main
> class.forName("org.postgresql.Driver")
> Driver.getConnection(....
>
> and see if that connects
>
> see below for more comments
> On 5-Feb-08, at 8:17 AM, Brian Tomaszewski wrote:
>
>> Guy,
>>
>> Thanks for the response. See below for clarifications:
>>
>> On Feb 5, 2008 1:05 AM, Guy Rouillier <guyr-ml1@burntmail.com> wrote:
>> Brian Tomaszewski wrote:
>> > I am having trouble connecting to a psql database running on   
>> Debian
>> > GNU/Linux system
>> >
>> > The version of psql I am using in the system is 8.2.6.
>> >
>> > No matter what I do, I continually am getting the error:
>> >
>> > /Backend start-up failed: FATAL:  database "RW_GEO" does not exist
>> >
>> > /when my JDBC component tries to connect using a URL like this:
>> >
>> > jdbc:postgresql://localhost:5432/RW_GEO
>> >
>> > from a tomcat app
>> >
>> > I have confirmed that the database RW_GEO does in fact exist as I  
>> can
>> > see/query tables from it from psql.
>> >
>> > Also, when I run my app on my development machine (windows), I can
>> > connect via tomcat with no problems to my local psql server.
>>
>> I'm trying to follow your runtime environment, but some pieces are
>> missing.  When you say you can query the database running on Debian
>> using psql, is that psql running on your Windows box or on the Debian
>> box?
>>
>> I can run psql (the command line tool) on Debian and using the psql  
>> tool on Debian see/query the database that is always being reported  
>> as not existing when the app connects.
>>
>> On my Windows box, I use pgAdmin interface. I also develop the Java  
>> Code for the app on windows and then upload it to the server to run/ 
>> tes. Also, I built the inital database on the windows box, and then  
>> uploaded and restored it to the debian postgres running there
>>
>>
>>
>>  I don't think this has anything to do with JDBC.  The URL you show
>> above has "localhost" as the server for the DB.  That's probably not
>> right, is it?  I wouldn't think you'd have Tomcat running on your
>> database server.
>>
>> yes, we do have tomcat running on the database server (i.e the  
>> debian server), is that a bad thing?
> It's not good, since tomcat and postgresql both like memory. However  
> you may not have a choice.
>
>>
>>
>> My thought with using localhost on the debain is that is that is  
>> how the tomcat could easily connect
>>
>>
>> So, run psql from whatever box is running Tomcat, and figure out  
>> how to
>> connect it to your DB server.
>>
>> I have done this on windows. Every thing for my app on windows is  
>> on the same box (tomcat, postgres etc). When I port the app up to  
>> the debian server, the connection fails
>>
>>
>> Once you've done that, you should be able
>> to just transfer the connection settings to JDBC.  I'm anticipating  
>> once
>> you attempt to do that, you'll encounter a connection error.  That's
>> because you need to update pg_hba.conf to allow access to your  
>> database
>> from remote hosts.
>>
>>
>> Ok, so is the real issue then having tomcat and postgres on the  
>> same server? Should they be physically separate? If they are not,  
>> what do you need to consider in terms of configuration
>>
> No, it's no real issue, other than a resource sharing problem.
>
> Dave
>
>> Thank you for your time
>>
>> Brian
>>
>>
>> --
>> Guy Rouillier
>>
>> ---------------------------(end of  
>> broadcast)---------------------------
>> TIP 7: You can help support the PostgreSQL project by donating at
>>
>>                http://www.postgresql.org/about/donate
>>
>
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 16:02  Brian Tomaszewski <brianbanjo@gmail.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 2 replies; 18+ messages in thread

From: Brian Tomaszewski @ 2008-02-05 16:02 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Guy Rouillier <guyr-ml1@burntmail.com>; pgsql-jdbc

Dave,

Thanks for the reply, answers below:

On Feb 5, 2008 10:39 AM, Dave Cramer <pg@fastcrypt.com> wrote:

> Brian,
> So to be clear you are using jdbc:postgresql://localhost:5432/dbname
>
> on both your windows box and your linux box.
>

yes - it works on windows but not on linux. I even tried adding useSSL=true
to the connection string and that didn't make a difference

>
> Both machines have copies of the database locally ?
>

yes


>
> what does the output of psql -l show on the debian box,
>

          List of databases
      Name      |  Owner   | Encoding
----------------+----------+----------
 RW_GEO         | postgres | UTF8
 lowercase_test | postgres | UTF8
 postgres       | postgres | LATIN1
 template0      | postgres | LATIN1
 template1      | postgres | LATIN1
(5 rows)


and is it listening on a tcpip port ?
>


Does "it" refer to the postgres server? if so, how do I check that it is
listening on a TCPIP port? (sorry if this sounds trivial, I am relatively
new to postgres on linux)

Thanks!

Brian



>
> Dave
>
> On 5-Feb-08, at 9:31 AM, Brian Tomaszewski wrote:
>
> Dave,
>
> Thanks for the quick reply.
>
> I am using java code like what you show to connect to postresql in my app
>
> And that's part of the weird thing - java connect code with postgres
> database on windows is fine, same java code trying to connect to to a
> postgres database  on debian, can't connect or even see the database for
> that matter
>
> Could it be a driver version issue?
>
> Thanks again for your time
>
> Brian
>
>
>
> On Feb 5, 2008 8:47 AM, Dave Cramer <pg@fastcrypt.com> wrote:
>
> > Brian,
> > I have no idea why you can't connect but I have comments about running
> > tomcat and pg below
> >
> > write a very small program which attempts to connect outside of tomcat
> >
> > ie
> >
> > main
> > class.forName("org.postgresql.Driver")
> > Driver.getConnection(....
> >
> > and see if that connects
> >
> > see below for more comments
> > On 5-Feb-08, at 8:17 AM, Brian Tomaszewski wrote:
> >
> > Guy,
> >
> > Thanks for the response. See below for clarifications:
> >
> > On Feb 5, 2008 1:05 AM, Guy Rouillier <guyr-ml1@burntmail.com> wrote:
> >
> > > Brian Tomaszewski wrote:
> > > > I am having trouble connecting to a psql database running on  Debian
> > > > GNU/Linux system
> > > >
> > > > The version of psql I am using in the system is 8.2.6.
> > > >
> > > > No matter what I do, I continually am getting the error:
> > > >
> > > > /Backend start-up failed: FATAL:  database "RW_GEO" does not exist
> > > >
> > > > /when my JDBC component tries to connect using a URL like this:
> > > >
> > > > jdbc:postgresql://localhost:5432/RW_GEO
> > > >
> > > > from a tomcat app
> > > >
> > > > I have confirmed that the database RW_GEO does in fact exist as I
> > > can
> > > > see/query tables from it from psql.
> > > >
> > > > Also, when I run my app on my development machine (windows), I can
> > > > connect via tomcat with no problems to my local psql server.
> > >
> > > I'm trying to follow your runtime environment, but some pieces are
> > > missing.  When you say you can query the database running on Debian
> > > using psql, is that psql running on your Windows box or on the Debian
> > > box?
> >
> >
> > I can run psql (the command line tool) on Debian and using the psql tool
> > on Debian see/query the database that is always being reported as not
> > existing when the app connects.
> >
> > On my Windows box, I use pgAdmin interface. I also develop the Java Code
> > for the app on windows and then upload it to the server to run/tes. Also, I
> > built the inital database on the windows box, and then uploaded and restored
> > it to the debian postgres running there
> >
> >
> >
> >
> > >  I don't think this has anything to do with JDBC.  The URL you show
> > > above has "localhost" as the server for the DB.  That's probably not
> > > right, is it?  I wouldn't think you'd have Tomcat running on your
> > > database server.
> >
> >
> > yes, we do have tomcat running on the database server (i.e the debian
> > server), is that a bad thing?
> >
> > It's not good, since tomcat and postgresql both like memory. However you
> > may not have a choice.
> >
> >
> >
> > My thought with using localhost on the debain is that is that is how the
> > tomcat could easily connect
> >
> >
> > So, run psql from whatever box is running Tomcat, and figure out how to
> > > connect it to your DB server.
> >
> >
> > I have done this on windows. Every thing for my app on windows is on the
> > same box (tomcat, postgres etc). When I port the app up to the debian
> > server, the connection fails
> >
> >
> >
> > > Once you've done that, you should be able
> > > to just transfer the connection settings to JDBC.  I'm anticipating
> > > once
> > > you attempt to do that, you'll encounter a connection error.  That's
> > > because you need to update pg_hba.conf to allow access to your
> > > database
> > > from remote hosts.
> > >
> >
> >
> > Ok, so is the real issue then having tomcat and postgres on the same
> > server? Should they be physically separate? If they are not, what do you
> > need to consider in terms of configuration
> >
> > No, it's no real issue, other than a resource sharing problem.
> >
> > Dave
> >
> > Thank you for your time
> >
> > Brian
> >
> >
> > >
> > > --
> > > Guy Rouillier
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 7: You can help support the PostgreSQL project by donating at
> > >
> > >                http://www.postgresql.org/about/donate
> > >
> >
> >
> >
>
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 16:14  Dave Cramer <pg@fastcrypt.com>
  parent: Brian Tomaszewski <brianbanjo@gmail.com>
  1 sibling, 1 reply; 18+ messages in thread

From: Dave Cramer @ 2008-02-05 16:14 UTC (permalink / raw)
  To: Brian Tomaszewski <brianbanjo@gmail.com>; +Cc: Guy Rouillier <guyr-ml1@burntmail.com>; pgsql-jdbc

Brian,

So my guess is that you can connect to the lowercase_test database on  
that machine.

if so, rename the RW_GEO to lower case. UPPER CASE really is an  
impedance mismatch on postgresql ( in other words don't do it) .

Dave
On 5-Feb-08, at 11:02 AM, Brian Tomaszewski wrote:

> Dave,
>
> Thanks for the reply, answers below:
>
> On Feb 5, 2008 10:39 AM, Dave Cramer <pg@fastcrypt.com> wrote:
> Brian,
>
> So to be clear you are using jdbc:postgresql://localhost:5432/dbname
>
> on both your windows box and your linux box.
>
> yes - it works on windows but not on linux. I even tried adding  
> useSSL=true to the connection string and that didn't make a difference
>
> Both machines have copies of the database locally ?
>
> yes
>
>
> what does the output of psql -l show on the debian box,
>
>           List of databases
>       Name      |  Owner   | Encoding
> ----------------+----------+----------
>  RW_GEO         | postgres | UTF8
>  lowercase_test | postgres | UTF8
>  postgres       | postgres | LATIN1
>  template0      | postgres | LATIN1
>  template1      | postgres | LATIN1
> (5 rows)
>
>
> and is it listening on a tcpip port ?
>
>
> Does "it" refer to the postgres server? if so, how do I check that  
> it is listening on a TCPIP port? (sorry if this sounds trivial, I am  
> relatively new to postgres on linux)
>
> Thanks!
>
> Brian
>
>
>
> Dave
>
> On 5-Feb-08, at 9:31 AM, Brian Tomaszewski wrote:
>
>> Dave,
>>
>> Thanks for the quick reply.
>>
>> I am using java code like what you show to connect to postresql in  
>> my app
>>
>> And that's part of the weird thing - java connect code with  
>> postgres database on windows is fine, same java code trying to  
>> connect to to a postgres database  on debian, can't connect or even  
>> see the database for that matter
>>
>> Could it be a driver version issue?
>>
>> Thanks again for your time
>>
>> Brian
>>
>>
>>
>> On Feb 5, 2008 8:47 AM, Dave Cramer <pg@fastcrypt.com> wrote:
>> Brian,
>>
>> I have no idea why you can't connect but I have comments about  
>> running tomcat and pg below
>>
>> write a very small program which attempts to connect outside of  
>> tomcat
>>
>> ie
>>
>> main
>> class.forName("org.postgresql.Driver")
>> Driver.getConnection(....
>>
>> and see if that connects
>>
>> see below for more comments
>> On 5-Feb-08, at 8:17 AM, Brian Tomaszewski wrote:
>>
>>> Guy,
>>>
>>> Thanks for the response. See below for clarifications:
>>>
>>> On Feb 5, 2008 1:05 AM, Guy Rouillier <guyr-ml1@burntmail.com>  
>>> wrote:
>>> Brian Tomaszewski wrote:
>>> > I am having trouble connecting to a psql database running on   
>>> Debian
>>> > GNU/Linux system
>>> >
>>> > The version of psql I am using in the system is 8.2.6.
>>> >
>>> > No matter what I do, I continually am getting the error:
>>> >
>>> > /Backend start-up failed: FATAL:  database "RW_GEO" does not exist
>>> >
>>> > /when my JDBC component tries to connect using a URL like this:
>>> >
>>> > jdbc:postgresql://localhost:5432/RW_GEO
>>> >
>>> > from a tomcat app
>>> >
>>> > I have confirmed that the database RW_GEO does in fact exist as  
>>> I can
>>> > see/query tables from it from psql.
>>> >
>>> > Also, when I run my app on my development machine (windows), I can
>>> > connect via tomcat with no problems to my local psql server.
>>>
>>> I'm trying to follow your runtime environment, but some pieces are
>>> missing.  When you say you can query the database running on Debian
>>> using psql, is that psql running on your Windows box or on the  
>>> Debian
>>> box?
>>>
>>> I can run psql (the command line tool) on Debian and using the  
>>> psql tool on Debian see/query the database that is always being  
>>> reported as not existing when the app connects.
>>>
>>> On my Windows box, I use pgAdmin interface. I also develop the  
>>> Java Code for the app on windows and then upload it to the server  
>>> to run/tes. Also, I built the inital database on the windows box,  
>>> and then uploaded and restored it to the debian postgres running  
>>> there
>>>
>>>
>>>
>>>  I don't think this has anything to do with JDBC.  The URL you show
>>> above has "localhost" as the server for the DB.  That's probably not
>>> right, is it?  I wouldn't think you'd have Tomcat running on your
>>> database server.
>>>
>>> yes, we do have tomcat running on the database server (i.e the  
>>> debian server), is that a bad thing?
>> It's not good, since tomcat and postgresql both like memory.  
>> However you may not have a choice.
>>
>>>
>>>
>>> My thought with using localhost on the debain is that is that is  
>>> how the tomcat could easily connect
>>>
>>>
>>> So, run psql from whatever box is running Tomcat, and figure out  
>>> how to
>>> connect it to your DB server.
>>>
>>> I have done this on windows. Every thing for my app on windows is  
>>> on the same box (tomcat, postgres etc). When I port the app up to  
>>> the debian server, the connection fails
>>>
>>>
>>> Once you've done that, you should be able
>>> to just transfer the connection settings to JDBC.  I'm  
>>> anticipating once
>>> you attempt to do that, you'll encounter a connection error.  That's
>>> because you need to update pg_hba.conf to allow access to your  
>>> database
>>> from remote hosts.
>>>
>>>
>>> Ok, so is the real issue then having tomcat and postgres on the  
>>> same server? Should they be physically separate? If they are not,  
>>> what do you need to consider in terms of configuration
>>>
>> No, it's no real issue, other than a resource sharing problem.
>>
>> Dave
>>
>>> Thank you for your time
>>>
>>> Brian
>>>
>>>
>>> --
>>> Guy Rouillier
>>>
>>> ---------------------------(end of  
>>> broadcast)---------------------------
>>> TIP 7: You can help support the PostgreSQL project by donating at
>>>
>>>                http://www.postgresql.org/about/donate
>>>
>>
>>
>
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 16:25  Brian Tomaszewski <brianbanjo@gmail.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 18+ messages in thread

From: Brian Tomaszewski @ 2008-02-05 16:25 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Guy Rouillier <guyr-ml1@burntmail.com>; pgsql-jdbc

Hi Dave,

No, I can't connect to the lowercase_test database either.. I tried that
right after you recommended it, and same problem... (i.e can't find
database)

Thanks

Brian

On Feb 5, 2008 11:14 AM, Dave Cramer <pg@fastcrypt.com> wrote:

> Brian,
> So my guess is that you can connect to the lowercase_test database on that
> machine.
>
> if so, rename the RW_GEO to lower case. UPPER CASE really is an impedance
> mismatch on postgresql ( in other words don't do it) .
>
> Dave
>
> On 5-Feb-08, at 11:02 AM, Brian Tomaszewski wrote:
>
> Dave,
>
> Thanks for the reply, answers below:
>
> On Feb 5, 2008 10:39 AM, Dave Cramer <pg@fastcrypt.com> wrote:
>
> > Brian,
> > So to be clear you are using jdbc:postgresql://localhost:5432/dbname
> >
> > on both your windows box and your linux box.
> >
>
> yes - it works on windows but not on linux. I even tried adding
> useSSL=true to the connection string and that didn't make a difference
>
> >
> > Both machines have copies of the database locally ?
> >
>
> yes
>
>
> >
> > what does the output of psql -l show on the debian box,
> >
>
>           List of databases
>       Name      |  Owner   | Encoding
> ----------------+----------+----------
>  RW_GEO         | postgres | UTF8
>  lowercase_test | postgres | UTF8
>  postgres       | postgres | LATIN1
>  template0      | postgres | LATIN1
>  template1      | postgres | LATIN1
> (5 rows)
>
>
> and is it listening on a tcpip port ?
> >
>
>
> Does "it" refer to the postgres server? if so, how do I check that it is
> listening on a TCPIP port? (sorry if this sounds trivial, I am relatively
> new to postgres on linux)
>
> Thanks!
>
> Brian
>
>
>
> >
> > Dave
> >
> > On 5-Feb-08, at 9:31 AM, Brian Tomaszewski wrote:
> >
> > Dave,
> >
> > Thanks for the quick reply.
> >
> > I am using java code like what you show to connect to postresql in my
> > app
> >
> > And that's part of the weird thing - java connect code with postgres
> > database on windows is fine, same java code trying to connect to to a
> > postgres database  on debian, can't connect or even see the database for
> > that matter
> >
> > Could it be a driver version issue?
> >
> > Thanks again for your time
> >
> > Brian
> >
> >
> >
> > On Feb 5, 2008 8:47 AM, Dave Cramer <pg@fastcrypt.com> wrote:
> >
> > > Brian,
> > > I have no idea why you can't connect but I have comments about running
> > > tomcat and pg below
> > >
> > > write a very small program which attempts to connect outside of tomcat
> > >
> > > ie
> > >
> > > main
> > > class.forName("org.postgresql.Driver")
> > > Driver.getConnection(....
> > >
> > > and see if that connects
> > >
> > > see below for more comments
> > > On 5-Feb-08, at 8:17 AM, Brian Tomaszewski wrote:
> > >
> > > Guy,
> > >
> > > Thanks for the response. See below for clarifications:
> > >
> > > On Feb 5, 2008 1:05 AM, Guy Rouillier <guyr-ml1@burntmail.com> wrote:
> > >
> > > > Brian Tomaszewski wrote:
> > > > > I am having trouble connecting to a psql database running on
> > > >  Debian
> > > > > GNU/Linux system
> > > > >
> > > > > The version of psql I am using in the system is 8.2.6.
> > > > >
> > > > > No matter what I do, I continually am getting the error:
> > > > >
> > > > > /Backend start-up failed: FATAL:  database "RW_GEO" does not exist
> > > > >
> > > > > /when my JDBC component tries to connect using a URL like this:
> > > > >
> > > > > jdbc:postgresql://localhost:5432/RW_GEO
> > > > >
> > > > > from a tomcat app
> > > > >
> > > > > I have confirmed that the database RW_GEO does in fact exist as I
> > > > can
> > > > > see/query tables from it from psql.
> > > > >
> > > > > Also, when I run my app on my development machine (windows), I can
> > > > > connect via tomcat with no problems to my local psql server.
> > > >
> > > > I'm trying to follow your runtime environment, but some pieces are
> > > > missing.  When you say you can query the database running on Debian
> > > > using psql, is that psql running on your Windows box or on the
> > > > Debian
> > > > box?
> > >
> > >
> > > I can run psql (the command line tool) on Debian and using the psql
> > > tool on Debian see/query the database that is always being reported as not
> > > existing when the app connects.
> > >
> > > On my Windows box, I use pgAdmin interface. I also develop the Java
> > > Code for the app on windows and then upload it to the server to run/tes.
> > > Also, I built the inital database on the windows box, and then uploaded and
> > > restored it to the debian postgres running there
> > >
> > >
> > >
> > >
> > > >  I don't think this has anything to do with JDBC.  The URL you show
> > > > above has "localhost" as the server for the DB.  That's probably not
> > > > right, is it?  I wouldn't think you'd have Tomcat running on your
> > > > database server.
> > >
> > >
> > > yes, we do have tomcat running on the database server (i.e the debian
> > > server), is that a bad thing?
> > >
> > > It's not good, since tomcat and postgresql both like memory. However
> > > you may not have a choice.
> > >
> > >
> > >
> > > My thought with using localhost on the debain is that is that is how
> > > the tomcat could easily connect
> > >
> > >
> > > So, run psql from whatever box is running Tomcat, and figure out how
> > > > to
> > > > connect it to your DB server.
> > >
> > >
> > > I have done this on windows. Every thing for my app on windows is on
> > > the same box (tomcat, postgres etc). When I port the app up to the debian
> > > server, the connection fails
> > >
> > >
> > >
> > > > Once you've done that, you should be able
> > > > to just transfer the connection settings to JDBC.  I'm anticipating
> > > > once
> > > > you attempt to do that, you'll encounter a connection error.  That's
> > > > because you need to update pg_hba.conf to allow access to your
> > > > database
> > > > from remote hosts.
> > > >
> > >
> > >
> > > Ok, so is the real issue then having tomcat and postgres on the same
> > > server? Should they be physically separate? If they are not, what do you
> > > need to consider in terms of configuration
> > >
> > > No, it's no real issue, other than a resource sharing problem.
> > >
> > > Dave
> > >
> > > Thank you for your time
> > >
> > > Brian
> > >
> > >
> > > >
> > > > --
> > > > Guy Rouillier
> > > >
> > > > ---------------------------(end of
> > > > broadcast)---------------------------
> > > > TIP 7: You can help support the PostgreSQL project by donating at
> > > >
> > > >                http://www.postgresql.org/about/donate
> > > >
> > >
> > >
> > >
> >
> >
>
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 17:27  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Brian Tomaszewski <brianbanjo@gmail.com>
  1 sibling, 1 reply; 18+ messages in thread

From: Tom Lane @ 2008-02-05 17:27 UTC (permalink / raw)
  To: Brian Tomaszewski <brianbanjo@gmail.com>; +Cc: Dave Cramer <pg@fastcrypt.com>; Guy Rouillier <guyr-ml1@burntmail.com>; pgsql-jdbc

"Brian Tomaszewski" <brianbanjo@gmail.com> writes:
> Does "it" refer to the postgres server? if so, how do I check that it is
> listening on a TCPIP port? (sorry if this sounds trivial, I am relatively
> new to postgres on linux)

try psql -h localhost -l

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: JDBC connection problem
@ 2008-02-05 21:21  Brian Tomaszewski <brianbanjo@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 18+ messages in thread

From: Brian Tomaszewski @ 2008-02-05 21:21 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Dave Cramer <pg@fastcrypt.com>; Guy Rouillier <guyr-ml1@burntmail.com>; pgsql-jdbc

All,

Thanks for the time and tips. Turned out to be a really stupid error - there
was on old version of postres on the server that had taken port 5432, and my
app was trying to connect to it (hence why the database wasn't being found),
when it should have been connecting to the correct, newer instance of
postres

I found this out by doing this command as Tom recommended:

$ psql -h localhost -l
psql: could not connect to server: Connection refused
        Is the server running on host "localhost" and accepting
        TCP/IP connections on port 5433?

And noticing the 5433...

A colleague of mine also noticed the multiple ports, and we now have things
cleared up.

Thanks again everyone for the replies/comments

Brian

On Feb 5, 2008 12:27 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> "Brian Tomaszewski" <brianbanjo@gmail.com> writes:
> > Does "it" refer to the postgres server? if so, how do I check that it is
> > listening on a TCPIP port? (sorry if this sounds trivial, I am
> relatively
> > new to postgres on linux)
>
> try psql -h localhost -l
>
>                        regards, tom lane
>

^ permalink  raw  reply  [nested|flat] 18+ messages in thread


end of thread, other threads:[~2008-02-05 21:21 UTC | newest]

Thread overview: 18+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-31 05:09 JDBC Connection Problem v j <jvs_a@yahoo.com>
2001-01-31 08:30 ` Peter T Mount <peter@retep.org.uk>
2007-02-01 14:46 jdbc connection problem david@mediagonal.ch
2007-02-01 17:33 ` Re: jdbc connection problem Kris Jurka <books@ejurka.com>
2007-02-02 10:30   ` Re: jdbc connection problem David Buchmann <david@mediagonal.ch>
2008-02-05 03:18 JDBC connection problem Brian Tomaszewski <brianbanjo@gmail.com>
2008-02-05 06:05 ` Re: JDBC connection problem Guy Rouillier <guyr-ml1@burntmail.com>
2008-02-05 11:29   ` Re: JDBC connection problem Dave Cramer <pg@fastcrypt.com>
2008-02-05 13:18     ` Re: JDBC connection problem Brian Tomaszewski <brianbanjo@gmail.com>
2008-02-05 13:17   ` Re: JDBC connection problem Brian Tomaszewski <brianbanjo@gmail.com>
2008-02-05 13:47     ` Re: JDBC connection problem Dave Cramer <pg@fastcrypt.com>
2008-02-05 14:31       ` Re: JDBC connection problem Brian Tomaszewski <brianbanjo@gmail.com>
2008-02-05 15:39         ` Re: JDBC connection problem Dave Cramer <pg@fastcrypt.com>
2008-02-05 16:02           ` Re: JDBC connection problem Brian Tomaszewski <brianbanjo@gmail.com>
2008-02-05 16:14             ` Re: JDBC connection problem Dave Cramer <pg@fastcrypt.com>
2008-02-05 16:25               ` Re: JDBC connection problem Brian Tomaszewski <brianbanjo@gmail.com>
2008-02-05 17:27             ` Re: JDBC connection problem Tom Lane <tgl@sss.pgh.pa.us>
2008-02-05 21:21               ` Re: JDBC connection problem Brian Tomaszewski <brianbanjo@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox