pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nuno Zimas <nzimas@gmail.com>
To: Steven Schlansker <stevenschlansker@gmail.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: John R Pierce <pierce@hogranch.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: user can't access own database after creation
Date: Wed, 2 Dec 2015 20:52:52 +0000
Message-ID: <5B0A4EBE-9006-45A1-ACF0-0803D275AFDA@gmail.com> (raw)
In-Reply-To: <F0A9C984-855B-4A64-AD2A-D1630BD74AE9@gmail.com>
References: <25B91293-CCF8-42D9-B4ED-19DF36AA881C@gmail.com>
	<CAKFQuwa8Xaq+cmDBX+AJPK+K=1D5qYXnSNKEzbqpVkh46b6s-w@mail.gmail.com>
	<FF251EE8-DC7B-4EF4-8E99-9B89FDB825C8@gmail.com>
	<CADK3HHKUptgkHwH=fhsFLcKLdoXwXT0QA1ZHQOnvtyp3ZyQa_w@mail.gmail.com>
	<EFA851E5-863F-4D31-84B3-016FAC305BC5@gmail.com>
	<565F4D26.1050501@hogranch.com>
	<CADK3HHJtp_njvi4vdN+3QSuYXhvwqMKTroTvWdWNKBun9UhKyw@mail.gmail.com>
	<DBD6C16E-8834-44D1-8530-1F64F617B7EE@gmail.com>
	<CADK3HH+dwQ5qG5KCnNGZM-5Z+=ocSx9yqS9K_Vxr7CMm=k9h0A@mail.gmail.com>
	<1F7C5018-AB78-40D0-989F-330B81528B2C@gmail.com>
	<F0A9C984-855B-4A64-AD2A-D1630BD74AE9@gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Thanks, Steve. How silly of me :(
Still falling to compile, though.

root@aida2next /u/2next# javac TestUrl.java 
TestUrl.java:10: error: unreported exception SQLException; must be caught or declared to be thrown
    Connection con = java.sql.DriverManager.getConnection("jdbc:postgresql://10.10.10.100","postgres","smartdoc");
                                                         ^
TestUrl.java:11: error: unreported exception SQLException; must be caught or declared to be thrown
    con.createStatement().execute("select 1");
                       ^
TestUrl.java:11: error: unreported exception SQLException; must be caught or declared to be thrown
    con.createStatement().execute("select 1");
                                 ^
3 errors



> On 2 Dec 2015, at 20:50, Steven Schlansker <stevenschlansker@gmail.com> wrote:
> 
> That's easily fixed by adding the missing ';' just as the error indicates :)
> 
> On Dec 2, 2015, at 12:48 PM, Nuno Zimas <nzimas@gmail.com> wrote:
> 
>> 
>> Hi Dave,
>> 
>> I’m getting an error.
>> 
>> root@aida2next /u/2next# javac TestUrl.java 
>> TestUrl.java:1: error: ';' expected
>> import java.sql.Connection
>>                          ^
>> 1 error
>> 
>> 
>> 
>>> On 2 Dec 2015, at 20:39, Dave Cramer <pg@fastcrypt.com> wrote:
>>> 
>>> this isn't compiled, but it has no dependencies to compile and only one to run
>>> 
>>> import java.sql.Connection
>>> 
>>> /**
>>> * Created by davec on 2014-03-28.
>>> */
>>> class TestUrl
>>> {
>>>  public static void main(String []args)
>>>  {
>>>    Connection con = java.sql.DriverManager.getConnection("jdbc:postgresql://yourhost","youruser","password");
>>>    con.createStatement().execute("select 1");
>>>  }
>>> }
>>> save it in a file called TestUrl.java
>>> compile it with javac TestUrl.java
>>> run it with java -cp postgresql.jar:./ TestUrl
>>> 
>>> change the names above to suit
>>> 
>>> Dave Cramer
>>> 
>>> davec@postgresintl.com
>>> www.postgresintl.com
>>> 
>>> On 2 December 2015 at 15:35, Nuno Zimas <nzimas@gmail.com> wrote:
>>> 
>>>> On 2 Dec 2015, at 20:18, Dave Cramer <pg@fastcrypt.com> wrote:
>>>> 
>>>> Can you try a very simple JDBC program to see if you can connect ?
>>>> 
>>>> Dave Cramer
>>> 
>>> Could you please suggest one already compiled?
>>> I’m not a java programmer and it’s been hell on rather to compile even the simplest java source file due to dependency issues.
>>> 
>>>> 
>>>> davec@postgresintl.com
>>>> www.postgresintl.com
>>>> 
>>>> On 2 December 2015 at 14:57, John R Pierce <pierce@hogranch.com> wrote:
>>>> On 12/2/2015 11:55 AM, Nuno Zimas wrote:
>>>> psql always connects successfully no matter what.
>>>> As for JDBC, we get the same results with or without ssl=true explicitly appended to the URL.
>>>> What truly baffles me is that ye exact same java application works with no hiccups against a quasi-vanilla pgsql backend i’ve installed on windows 10.
>>>> So far, the only visible difference I found is in the values for LC_COLLATE and LC_TYPE, which is V on the remote pgsql instances and English_United States.1252 on the local pgsql instance.
>>>> Not sure how tis would affect accessing the DBs, though.
>>>> 
>>>> can you connect using psql on the windows system to the ubuntu hosted database?
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> john r pierce, recycling bits in santa cruz
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>> 
>>> 
>>> 
>> 
> 

view thread (53+ messages)  latest in thread

Message-ID: <5B0A4EBE-9006-45A1-ACF0-0803D275AFDA@gmail.com>
Permalink:  ../5B0A4EBE-9006-45A1-ACF0-0803D275AFDA@gmail.com/
Also on:    postgresql.org/message-id/5B0A4EBE-9006-45A1-ACF0-0803D275AFDA@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: nzimas@gmail.com, stevenschlansker@gmail.com, pg@fastcrypt.com, pierce@hogranch.com
  Subject: Re: user can't access own database after creation
  In-Reply-To: <5B0A4EBE-9006-45A1-ACF0-0803D275AFDA@gmail.com>
  References: <25B91293-CCF8-42D9-B4ED-19DF36AA881C@gmail.com> <CAKFQuwa8Xaq+cmDBX+AJPK+K=1D5qYXnSNKEzbqpVkh46b6s-w@mail.gmail.com> <FF251EE8-DC7B-4EF4-8E99-9B89FDB825C8@gmail.com> <CADK3HHKUptgkHwH=fhsFLcKLdoXwXT0QA1ZHQOnvtyp3ZyQa_w@mail.gmail.com> <EFA851E5-863F-4D31-84B3-016FAC305BC5@gmail.com> <565F4D26.1050501@hogranch.com> <CADK3HHJtp_njvi4vdN+3QSuYXhvwqMKTroTvWdWNKBun9UhKyw@mail.gmail.com> <DBD6C16E-8834-44D1-8530-1F64F617B7EE@gmail.com> <CADK3HH+dwQ5qG5KCnNGZM-5Z+=ocSx9yqS9K_Vxr7CMm=k9h0A@mail.gmail.com> <1F7C5018-AB78-40D0-989F-330B81528B2C@gmail.com> <F0A9C984-855B-4A64-AD2A-D1630BD74AE9@gmail.com> <5B0A4EBE-9006-45A1-ACF0-0803D275AFDA@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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