pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
jdbc problem
13+ messages / 12 participants
[nested] [flat]

* jdbc problem
@ 1999-10-15 19:36 soundar rajan <psrajan@yahoo.com>
  1999-10-17 05:02 ` Re: [GENERAL] jdbc problem Jim Richards <grumpy@cyber4.org>
  0 siblings, 1 reply; 13+ messages in thread

From: soundar rajan @ 1999-10-15 19:36 UTC (permalink / raw)
  To: pgsql-general

Hi,

I am using postgresql under linux.  Now that I need to
build up the jdbc driver for postgresql, when I make
under the directory /src/interfaces/jdbc.. I get an
error stating '(u' unexpected syntax... 

The version returned by the make is 1.0b4.  The
makeVersion.java file returns jdbc0 as the output and
so, the postgresql.jar file is not been created.

How do I go about this?  Any help would be
appreciated.

Thanks.
Soundar.  

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com



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

* Re: [GENERAL] jdbc problem
  1999-10-15 19:36 jdbc problem soundar rajan <psrajan@yahoo.com>
@ 1999-10-17 05:02 ` Jim Richards <grumpy@cyber4.org>
  0 siblings, 0 replies; 13+ messages in thread

From: Jim Richards @ 1999-10-17 05:02 UTC (permalink / raw)
  To: soundar rajan <psrajan@yahoo.com>; pgsql-general


>I am using postgresql under linux.  Now that I need to
>build up the jdbc driver for postgresql, when I make
>under the directory /src/interfaces/jdbc.. I get an
>error stating '(u' unexpected syntax... 
>
>The version returned by the make is 1.0b4.  The
>makeVersion.java file returns jdbc0 as the output and
>so, the postgresql.jar file is not been created.

run

	make jdbc1

for the version 1 driver (jdk 1.1) and

	make jdbc2

for the version 2 driver (java2) ...

then for each build, run

	 jar -cf postgresql.jar `find postgresql -name "*.class" -print`

to make the jar file.


--
Subvert the dominant paradigm
 http://www.cyber4.org/members/grumpy/index.html



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

* JDBC problem
@ 1999-10-19 16:13 soundar rajan <psrajan@yahoo.com>
  1999-10-19 19:49 ` Re: [GENERAL] JDBC problem Peter Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 13+ messages in thread

From: soundar rajan @ 1999-10-19 16:13 UTC (permalink / raw)
  To: pgsql-general

Hi all,

Thanks for the responses.  I'm running postgreSQL
6.5.2 under Linux 6.1.  I need to access the DB using
JDK (either 1.1 or 1.2, doesn't really matter a lot). 
The problem I face is on the creation of the
postgresql.jar, the driver for the connection. 

When I try to make under the /src/interfaces/jdbc
directory, it fails.  On making it, either I ge 47
errors or the make fails stating some errors -- '(u'
unexpected syntax error , /bin/sh -- I've the
jdbc6.5-1.1.jar (from retep,org.uk) in the same
directory and my path is set to the jdk1.1.3/bin
directory.  I(I was advised dk1.2 doesn't work well
for Linux).  Can anyone help me in overcoming this
step.  

Urgent please.
Thanks in advacnce.
Soundar.

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com



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

* Re: [GENERAL] JDBC problem
  1999-10-19 16:13 JDBC problem soundar rajan <psrajan@yahoo.com>
@ 1999-10-19 19:49 ` Peter Mount <peter@retep.org.uk>
  0 siblings, 0 replies; 13+ messages in thread

From: Peter Mount @ 1999-10-19 19:49 UTC (permalink / raw)
  To: soundar rajan <psrajan@yahoo.com>; +Cc: pgsql-general

On Tue, 19 Oct 1999, soundar rajan wrote:

> Hi all,
> 
> Thanks for the responses.  I'm running postgreSQL
> 6.5.2 under Linux 6.1.  I need to access the DB using
> JDK (either 1.1 or 1.2, doesn't really matter a lot). 
> The problem I face is on the creation of the
> postgresql.jar, the driver for the connection. 
> 
> When I try to make under the /src/interfaces/jdbc
> directory, it fails.  On making it, either I ge 47
> errors or the make fails stating some errors -- '(u'
> unexpected syntax error , /bin/sh -- I've the
> jdbc6.5-1.1.jar (from retep,org.uk) in the same
> directory and my path is set to the jdk1.1.3/bin
> directory.  I(I was advised dk1.2 doesn't work well
> for Linux).  Can anyone help me in overcoming this
> step.  

I've got to put 1.1.7 back on my linux box, but 1.2 is working very well -
but I've tended to miss out on the problems.

Now the jdbc6.5-1.1.jar file is infact the 6.5.1 version driver, so as
your java.version string is not correct, you'll have to run your app
like:

	java -Djava.version=1.1 your.class

It's for this reason I changed how this is handled in 6.5.2. However,
because I haven't got 1.1.7 on my development machine (I reinstalled it
recently) I haven't had chance to rebuild the jdbc6.5-1.1.jar file. The
jdbc6.5-1.2.jar file is the new version however.

> Urgent please.

Tip, although I shouldn't say this (as it's against the works internet
policy, but then I police it anyhow :-) ), cc my work's email address:

	petermount@it.maidstone.gov.uk

That way, I can catch the emails from both here and at work.

Peter

> Thanks in advacnce.
> Soundar.
> 
> __________________________________________________
> Do You Yahoo!?
> Bid and sell for free at http://auctions.yahoo.com
> 
> ************
> 

--
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf




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

* jdbc problem
@ 2002-11-07 04:37 Lee Tuck <tuckkhai@yahoo.com>
  0 siblings, 0 replies; 13+ messages in thread

From: Lee Tuck @ 2002-11-07 04:37 UTC (permalink / raw)
  To: pgsql-general

hi,
i wrote a program to connect to the postgresql
database using the jdbc driver provided by the cygwin
installer. I manage to connect to the postgresql
server but i faced the below problem when i close my
program. 
DEBUG: pq_recvbuf: unexpected EOF on client connection
DEBUG: pq_recvbuf:recv() failed: connection reset by
peer
after a few time upon the connection on and off of my
program, the below problems occured:
connection startup failed <fork failed>: Resource
temporarily unavailable
i tried my program using the mysql but the above
problems doesn't seem to occur.
Please help..
Thanks in advance
Regards,
Lee


__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2



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

* jdbc problem
@ 2003-04-24 01:38 milimeter@163.com <milimeter@163.com>
  2003-04-24 09:15 ` Re: jdbc problem Richard Huxton <dev@archonet.com>
  0 siblings, 1 reply; 13+ messages in thread

From: milimeter@163.com @ 2003-04-24 01:38 UTC (permalink / raw)
  To: pgsql-general

Hi, all

    I have a table: CREATE TABLE person (age char(4))
    After executing "select age from person" with jdbc, I extract the value 
with: 
    getInt("age")
    Now is the problem, the same code can succeed on oracle, but on 
postgresql, because of not triming space automaticlly, it cause an error.

    So, I hope the newest jdbc driver for postgresql can automaticlly trim 
space just like oracle. The same problem also exists when execute insert:
    Provided "age" is an integer, then "insert into person values ('30')" can 
be executed correctly, but "insert into person values ('')" can not. On 
oracle, a default value will be added. So jdbc driver for postgresql should 
also do it.

    Yours,
    mili




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

* Re: jdbc problem
  2003-04-24 01:38 jdbc problem milimeter@163.com <milimeter@163.com>
@ 2003-04-24 09:15 ` Richard Huxton <dev@archonet.com>
  0 siblings, 0 replies; 13+ messages in thread

From: Richard Huxton @ 2003-04-24 09:15 UTC (permalink / raw)
  To: milimeter@163.com, "milimeter@163.com" <milimeter@163.com>; pgsql-general

On Thursday 24 Apr 2003 2:38 am, milimeter@163.com wrote:
> Hi, all
>
>     I have a table: CREATE TABLE person (age char(4))
>     After executing "select age from person" with jdbc, I extract the value
> with:
>     getInt("age")
>     Now is the problem, the same code can succeed on oracle, but on
> postgresql, because of not triming space automaticlly, it cause an error.

If you don't want space-padded text, don't use char(), use varchar(). The 
char(4) column *always* contains four characters (space padded).

If for some reason you need to use char() types, then just trim it before 
applying getInt() or write your own function that can cope with trailing 
spaces.

>     So, I hope the newest jdbc driver for postgresql can automaticlly trim
> space just like oracle. The same problem also exists when execute insert:
>     Provided "age" is an integer, then "insert into person values ('30')"
> can be executed correctly, but "insert into person values ('')" can not. On
> oracle, a default value will be added. So jdbc driver for postgresql should
> also do it.

Oracle is probably treating the empty string as a null, which is where your 
default value is coming from. It shouldn't do this, since the empty string is 
not null.

Testing here, I can insert values of 30, '30', '' into a char(4) fine from the 
command-line. Ah! Unless where you say "age is an integer" you mean that the 
age column is of type integer, in which case PG can't translate an empty 
string into an integer (and nor can I). On the other hand, the string '30' 
can obviously be converted to an integer.

-- 
  Richard Huxton




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

* JDBC problem
@ 2004-05-11 10:36 Reynir Þór Hübner <reynir@hugsmidjan.is>
  2004-05-11 18:15 ` Re: JDBC problem Carl E. McMillin <carlymac@earthlink.net>
  0 siblings, 1 reply; 13+ messages in thread

From: Reynir Þór Hübner @ 2004-05-11 10:36 UTC (permalink / raw)
  To: pgsql-general

I'm running an engine with 15 databases, with fair amount of load. Every 
4-5 days I'm getting error like this from the java side and the 
application stops working (and wont come back unless I restart) :

java.net.SocketException: Broken pipe
   at java.net.SocketOutputStream.socketWrite0(Native Method)
   at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
   at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
   at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
   at java.io.BufferedOutputStream.write(BufferedOutputStream.java:110)
   at java.io.FilterOutputStream.write(FilterOutputStream.java:80)
   at org.postgresql.PG_Stream.Send(PG_Stream.java:87)
   at org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:184)
   at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:71)
   at 
org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:505)
   at 
org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:360)
   at 
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:48)
   at 
org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:176)
   at 
org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:163)
   at 
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:162)
   at 
com.eplica.model.persistence.JDBCPersistenceHelper.findByUniqueSql(JDBCPersistenceHelper.java:704)


Does anyone know what this is about ?
I'm using Red hat Enterprise, and all the correct JDBC drivers etc.


thanx
-reynir



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

* Re: JDBC problem
  2004-05-11 10:36 JDBC problem Reynir Þór Hübner <reynir@hugsmidjan.is>
@ 2004-05-11 18:15 ` Carl E. McMillin <carlymac@earthlink.net>
  0 siblings, 0 replies; 13+ messages in thread

From: Carl E. McMillin @ 2004-05-11 18:15 UTC (permalink / raw)
  To: 'Reynir Þór Hübner' <reynir@hugsmidjan.is>; pgsql-general

Hi,

>...I'm getting error like this from the java side and the 
>application stops working (and wont come back unless I restart...

How is the "application" invoked?  Is it a "service" (servlet instance, RMI
object-mediated, etc.), i.e. does a core-component run forever and spawn
helpers to handle requests?

I'd guess that you are slurping output from an external process'
STDOUT/STDERR and the process-control API noticed that one or both sides of
the conversation broke the underlying conduit (the pipe) between the
processes.

Carl <|};-)>



-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Reynir Þór Hübner
Sent: Tuesday, May 11, 2004 3:37 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] JDBC problem 


I'm running an engine with 15 databases, with fair amount of load. Every 
4-5 days I'm getting error like this from the java side and the 
application stops working (and wont come back unless I restart) :

java.net.SocketException: Broken pipe
   at java.net.SocketOutputStream.socketWrite0(Native Method)
   at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
   at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
   at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
   at java.io.BufferedOutputStream.write(BufferedOutputStream.java:110)
   at java.io.FilterOutputStream.write(FilterOutputStream.java:80)
   at org.postgresql.PG_Stream.Send(PG_Stream.java:87)
   at org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:184)
   at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:71)
   at 
org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection
.java:505)
   at 
org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.j
ava:360)
   at 
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.j
ava:48)
   at 
org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statem
ent.java:176)
   at 
org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statem
ent.java:163)
   at 
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement
.java:162)
   at 
com.eplica.model.persistence.JDBCPersistenceHelper.findByUniqueSql(JDBCPersi
stenceHelper.java:704)


Does anyone know what this is about ?
I'm using Red hat Enterprise, and all the correct JDBC drivers etc.


thanx
-reynir

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster





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

* jdbc problem
@ 2023-09-24 17:24 Raivo Rebane <raivo@r-systems.ee>
  0 siblings, 0 replies; 13+ messages in thread

From: Raivo Rebane @ 2023-09-24 17:24 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi,

I hav postgresql 15 installed in my windows computer.

I have maven java project, wich works temporarly in Eclipse, but mvn 
install did'nt work.

Now it works, but I have got error -

Exception in thread "main" java.lang.NoSuchMethodError: 
'org.postgresql.core.Encoding 
org.postgresql.core.BaseConnection.getEncoding()'
         at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1889)
         at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:438)
         at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:2406)
         at backendproject.BackendMain.main(BackendMain.java:64)

backendproject.BackendMain.main(BackendMain.java:64) line is following -

Timestamp oldest_timestamp= resultSet.getTimestamp("oldest_timestamp");

Query from Java is following -

String query= "SELECT timestamp AS oldest_timestamp FROM mushrooms";

PreparedStatement statement= connection.prepareStatement(query);

ResultSet resultSet= statement.executeQuery();

And pom.xml contains -

<dependencies>

<dependency>

<groupId>org.postgis</groupId>

<artifactId>postgis-jdbc</artifactId>

<version>1.3.3</version>

</dependency>

<dependency>

<groupId>org.postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>42.2.0</version>

</dependency>

and mvn install gives -

[INFO] --- dependency:3.6.0:copy-dependencies (copy-dependencies) @ 
backendproject --- [INFO] Copying postgis-jdbc-1.3.3.jar to 
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-1.3.3.jar 
[INFO] Copying postgis-stubs-1.3.3.jar to 
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-stubs-1.3.3.jar 
[INFO] Copying postgresql-8.3-603.jdbc4.jar to 
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-8.3-603.jdbc4.jar 
[INFO] Copying postgresql-42.2.0.jar to 
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.2.0.jar

What is reason of this error and how to resolv it ?

Regards

Raivo

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

* jdbc problem
@ 2023-09-24 17:33 Raivo Rebane <raivore55@gmail.com>
  2023-09-24 18:10 ` Re: jdbc problem postgresql439848@heinz-it.de
  2023-09-24 18:18 ` Re: jdbc problem Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 2 replies; 13+ messages in thread

From: Raivo Rebane @ 2023-09-24 17:33 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi,

I hav postgresql 15 installed in my windows computer.

I have maven java project, wich works temporarly in Eclipse, but mvn
install did'nt work.

Now it works, but I have got error -

Exception in thread "main" java.lang.NoSuchMethodError:
'org.postgresql.core.Encoding
org.postgresql.core.BaseConnection.getEncoding()'
        at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1889)
        at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:438)
        at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:2406)
        at backendproject.BackendMain.main(BackendMain.java:64)

backendproject.BackendMain.main(BackendMain.java:64) line is following -

Timestamp oldest_timestamp = resultSet.getTimestamp("oldest_timestamp");

Query from Java is following -

String query = "SELECT timestamp AS oldest_timestamp FROM mushrooms";

PreparedStatement statement = connection.prepareStatement(query);

ResultSet resultSet = statement.executeQuery();

And pom.xml contains -

<dependencies>

<dependency>

<groupId>org.postgis</groupId>

<artifactId>postgis-jdbc</artifactId>

<version>1.3.3</version>

</dependency>

<dependency>

<groupId>org.postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>42.2.0</version>

</dependency>

and mvn install gives -

[INFO] --- dependency:3.6.0:copy-dependencies (copy-dependencies) @
backendproject --- [INFO] Copying postgis-jdbc-1.3.3.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-1.3.3.jar
[INFO] Copying postgis-stubs-1.3.3.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-stubs-1.3.3.jar
[INFO] Copying postgresql-8.3-603.jdbc4.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-8.3-603.jdbc4.jar
[INFO] Copying postgresql-42.2.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.2.0.jar

What is reason of this error and how to resolv it ?

Regards

Raivo

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

* Re: jdbc problem
  2023-09-24 17:33 jdbc problem Raivo Rebane <raivore55@gmail.com>
@ 2023-09-24 18:10 ` postgresql439848@heinz-it.de
  1 sibling, 0 replies; 13+ messages in thread

From: postgresql439848@heinz-it.de @ 2023-09-24 18:10 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org


Am 24.09.23 um 19:33 schrieb Raivo Rebane:
> Hi,
>
> I hav postgresql 15 installed in my windows computer.
>
> I have maven java project, wich works temporarly in Eclipse, but mvn
> install did'nt work.
>
> Now it works, but I have got error -
>
> Exception in thread "main" java.lang.NoSuchMethodError:
> 'org.postgresql.core.Encoding
> org.postgresql.core.BaseConnection.getEncoding()'
>          at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1889)
>          at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:438)
>          at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:2406)
>          at backendproject.BackendMain.main(BackendMain.java:64)
>
> backendproject.BackendMain.main(BackendMain.java:64) line is following -
>
> Timestamp oldest_timestamp = resultSet.getTimestamp("oldest_timestamp");
>
> Query from Java is following -
>
> String query = "SELECT timestamp AS oldest_timestamp FROM mushrooms";
>
> PreparedStatement statement = connection.prepareStatement(query);
>
> ResultSet resultSet = statement.executeQuery();
>
> And pom.xml contains -
>
> <dependencies>
>
> <dependency>
>
> <groupId>org.postgis</groupId>
>
> <artifactId>postgis-jdbc</artifactId>
>
> <version>1.3.3</version>
>
> </dependency>
>
> <dependency>
>
> <groupId>org.postgresql</groupId>
>
> <artifactId>postgresql</artifactId>
>
> <version>42.2.0</version>
>
> </dependency>
>
> and mvn install gives -
>
> [INFO] --- dependency:3.6.0:copy-dependencies (copy-dependencies) @
> backendproject --- [INFO] Copying postgis-jdbc-1.3.3.jar to
> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-1.3.3.jar
> [INFO] Copying postgis-stubs-1.3.3.jar to
> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-stubs-1.3.3.jar
> [INFO] Copying postgresql-8.3-603.jdbc4.jar to
> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-8.3-603.jdbc4.jar
> [INFO] Copying postgresql-42.2.0.jar to
> C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.2.0.jar
>
> What is reason of this error and how to resolv it ?
>
> Regards
>
> Raivo
>
i would try to reorder the maven dependencies, so postgresql part is 
loaded first.

or like other people with same error, try exclude postgis-stubs from 
postgis-jdbc:

|<dependency>
||<groupId>org.postgis</groupId>
||<artifactId>postgis-jdbc</artifactId>
||<version>1.3.3</version>
||<scope>compile</scope>
||<exclusions>
||<exclusion>
||<groupId>org.postgis</groupId>
||<artifactId>postgis-stubs</artifactId>
||</exclusion>
||</exclusions>
||</dependency>|





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

* Re: jdbc problem
  2023-09-24 17:33 jdbc problem Raivo Rebane <raivore55@gmail.com>
@ 2023-09-24 18:18 ` Laurenz Albe <laurenz.albe@cybertec.at>
  1 sibling, 0 replies; 13+ messages in thread

From: Laurenz Albe @ 2023-09-24 18:18 UTC (permalink / raw)
  To: Raivo Rebane <raivore55@gmail.com>; pgsql-general@lists.postgresql.org

On Sun, 2023-09-24 at 20:33 +0300, Raivo Rebane wrote:
> I hav postgresql 15 installed in my windows computer.
> 
> I have maven java project, wich works temporarly in Eclipse, but mvn install did'nt work.
> 
> Now it works, but I have got error -
> 
> Exception in thread "main" java.lang.NoSuchMethodError: 'org.postgresql.core.Encoding org.postgresql.core.BaseConnection.getEncoding()'
>          at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1889)
>          at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:438)
>          at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:2406)
>          at backendproject.BackendMain.main(BackendMain.java:64)
> 
> backendproject.BackendMain.main(BackendMain.java:64) line is following -
> 
> Timestamp oldest_timestamp = resultSet.getTimestamp("oldest_timestamp");
> 
> Query from Java is following - 
> 
>             String query = "SELECT timestamp AS oldest_timestamp FROM mushrooms";
>             PreparedStatement statement = connection.prepareStatement(query);
>             ResultSet resultSet = statement.executeQuery();

You should ask the JDBC driver mailing list.

As a first measure, try upgrading to 42.6.0 and see if the error persists.

Yours,
Laurenz Albe





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


end of thread, other threads:[~2023-09-24 18:18 UTC | newest]

Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-10-15 19:36 jdbc problem soundar rajan <psrajan@yahoo.com>
1999-10-17 05:02 ` Jim Richards <grumpy@cyber4.org>
1999-10-19 16:13 JDBC problem soundar rajan <psrajan@yahoo.com>
1999-10-19 19:49 ` Re: [GENERAL] JDBC problem Peter Mount <peter@retep.org.uk>
2002-11-07 04:37 jdbc problem Lee Tuck <tuckkhai@yahoo.com>
2003-04-24 01:38 jdbc problem milimeter@163.com <milimeter@163.com>
2003-04-24 09:15 ` Richard Huxton <dev@archonet.com>
2004-05-11 10:36 JDBC problem Reynir Þór Hübner <reynir@hugsmidjan.is>
2004-05-11 18:15 ` Re: JDBC problem Carl E. McMillin <carlymac@earthlink.net>
2023-09-24 17:24 jdbc problem Raivo Rebane <raivo@r-systems.ee>
2023-09-24 17:33 jdbc problem Raivo Rebane <raivore55@gmail.com>
2023-09-24 18:10 ` postgresql439848@heinz-it.de
2023-09-24 18:18 ` Laurenz Albe <laurenz.albe@cybertec.at>

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