Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a4EOa-00049V-AT for pgsql-jdbc@arkaria.postgresql.org; Wed, 02 Dec 2015 20:53:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a4EOZ-00067i-Qs for pgsql-jdbc@arkaria.postgresql.org; Wed, 02 Dec 2015 20:52:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a4EOY-00064u-KH for pgsql-jdbc@postgresql.org; Wed, 02 Dec 2015 20:52:58 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1a4EOV-0004jp-1X for pgsql-jdbc@postgresql.org; Wed, 02 Dec 2015 20:52:58 +0000 Received: by wmvv187 with SMTP id v187so274172632wmv.1 for ; Wed, 02 Dec 2015 12:52:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=AGfW+wMzHYNh0O8uL61YZqCgi6VFB1n07NbHSlouL1o=; b=K0nn5yqEc0x4K04tZHEJXbSo1EWOvUCZ86C7K2fLCl0hK9I94vKYR0Ns6RoJuc2SNf qfsqNyIcAlykiLQ+6sIrHOl6eYp8wiXkDcTkkj/doy0/TjC46pPQbK3FMnobqabe1G8n o8NVdsreqR+PrCD4Nu8EWkyOhFYmuJSJA7qFwyw5/9kBcK8QC9zujOFfj22Bl3k3YaCP 9Lq+B67j1M0ZenussbGeVi9EzUgGEMp7O8ge8s06XMbELx33epFKVB5kwYuBos25n/uZ bOAdHkool/eyXGazoapK7UAHeBaOfccDddwgdtFGUmu4119MfDvtFQIt1SE4CVRe/Npu MZyQ== X-Received: by 10.194.89.170 with SMTP id bp10mr7221275wjb.7.1449089574292; Wed, 02 Dec 2015 12:52:54 -0800 (PST) Received: from [192.168.1.66] (123.209.115.89.rev.vodafone.pt. [89.115.209.123]) by smtp.gmail.com with ESMTPSA id 143sm32669923wmv.18.2015.12.02.12.52.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Dec 2015 12:52:53 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_A3611925-E462-4D7B-91BF-FDB7E1E4A67E" Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) Subject: Re: user can't access own database after creation From: Nuno Zimas In-Reply-To: Date: Wed, 2 Dec 2015 20:52:52 +0000 Cc: Dave Cramer , John R Pierce , List Message-Id: <5B0A4EBE-9006-45A1-ACF0-0803D275AFDA@gmail.com> References: <25B91293-CCF8-42D9-B4ED-19DF36AA881C@gmail.com> <565F4D26.1050501@hogranch.com> <1F7C5018-AB78-40D0-989F-330B81528B2C@gmail.com> To: Steven Schlansker X-Mailer: Apple Mail (2.3096.5) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org --Apple-Mail=_A3611925-E462-4D7B-91BF-FDB7E1E4A67E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Thanks, Steve. How silly of me :( Still falling to compile, though. root@aida2next /u/2next# javac TestUrl.java=20 TestUrl.java:10: error: unreported exception SQLException; must be = caught or declared to be thrown Connection con =3D = java.sql.DriverManager.getConnection("jdbc:postgresql://10.10.10.100","pos= tgres","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 = wrote: >=20 > That's easily fixed by adding the missing ';' just as the error = indicates :) >=20 > On Dec 2, 2015, at 12:48 PM, Nuno Zimas wrote: >=20 >>=20 >> Hi Dave, >>=20 >> I=92m getting an error. >>=20 >> root@aida2next /u/2next# javac TestUrl.java=20 >> TestUrl.java:1: error: ';' expected >> import java.sql.Connection >> ^ >> 1 error >>=20 >>=20 >>=20 >>> On 2 Dec 2015, at 20:39, Dave Cramer wrote: >>>=20 >>> this isn't compiled, but it has no dependencies to compile and only = one to run >>>=20 >>> import java.sql.Connection >>>=20 >>> /** >>> * Created by davec on 2014-03-28. >>> */ >>> class TestUrl >>> { >>> public static void main(String []args) >>> { >>> Connection con =3D = java.sql.DriverManager.getConnection("jdbc:postgresql://yourhost","youruse= r","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 >>>=20 >>> change the names above to suit >>>=20 >>> Dave Cramer >>>=20 >>> davec@postgresintl.com >>> www.postgresintl.com >>>=20 >>> On 2 December 2015 at 15:35, Nuno Zimas wrote: >>>=20 >>>> On 2 Dec 2015, at 20:18, Dave Cramer wrote: >>>>=20 >>>> Can you try a very simple JDBC program to see if you can connect ? >>>>=20 >>>> Dave Cramer >>>=20 >>> Could you please suggest one already compiled? >>> I=92m not a java programmer and it=92s been hell on rather to = compile even the simplest java source file due to dependency issues. >>>=20 >>>>=20 >>>> davec@postgresintl.com >>>> www.postgresintl.com >>>>=20 >>>> On 2 December 2015 at 14:57, John R Pierce = 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=3Dtrue = 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=92ve 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. >>>>=20 >>>> can you connect using psql on the windows system to the ubuntu = hosted database? >>>>=20 >>>>=20 >>>>=20 >>>> --=20 >>>> john r pierce, recycling bits in santa cruz >>>>=20 >>>>=20 >>>>=20 >>>> --=20 >>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >>>> To make changes to your subscription: >>>> http://www.postgresql.org/mailpref/pgsql-jdbc >>>>=20 >>>=20 >>>=20 >>=20 >=20 --Apple-Mail=_A3611925-E462-4D7B-91BF-FDB7E1E4A67E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252
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 =3D = java.sql.DriverManager.getConnection("jdbc:postgresql://10.10.10.100","pos= tgres","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



<= /div>
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=92m getting an error.

root@aida2next /u/2next# javac TestUrl.java =
TestUrl.java:1: error: ';' expected
import = java.sql.Connection
=             &n= bsp;           &nbs= p;^
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 =3D = java.sql.DriverManager.getConnection("jdbc:postgresql://yourhost","youruse= r","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=92m not a java programmer and it=92s = 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=3Dtrue= 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=92ve 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





= --Apple-Mail=_A3611925-E462-4D7B-91BF-FDB7E1E4A67E--