pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres JDBC driver (80b1.308) bug
4+ messages / 3 participants
[nested] [flat]
* Postgres JDBC driver (80b1.308) bug
@ 2005-01-11 20:37 j.random.programmer <javadesigner@yahoo.com>
0 siblings, 1 reply; 4+ messages in thread
From: j.random.programmer @ 2005-01-11 20:37 UTC (permalink / raw)
To: pgsql-jdbc
The postgresql 8 version 308 JDBC driver is broken
(jar file: pg80b1.308.jdbc3.jar)
I am running this driver against postgres 7.4.
The System.out.println gives a stack overflow error
because
the Statement toString() is broken !!
The following code illustrates the problem. I'm amazed
that Statement.toString() would cause this kind of
problem --
aren't the driver writers testing toString() methods
of various
implementation classes ?
Best regards,
--j
------------- code
---------------------------------------
import java.sql.*;
import java.io.*;
public class foo
{
public static void main (String args[]) throws
Exception
{
Connection con = getConnection();
String where_stmt = "SELECT a, b, c from alltypes
WHERE id = 39";
Statement stmt = con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
System.out.println(stmt); //<-------- ERROR HERE
}
static Connection getConnection() throws Exception {
//return a connection here, implement for your system
}
}
--------------------------- end ----------------------
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Postgres JDBC driver (80b1.308) bug
@ 2005-01-11 21:05 Kris Jurka <books@ejurka.com>
parent: j.random.programmer <javadesigner@yahoo.com>
0 siblings, 1 reply; 4+ messages in thread
From: Kris Jurka @ 2005-01-11 21:05 UTC (permalink / raw)
To: j.random.programmer <javadesigner@yahoo.com>; +Cc: pgsql-jdbc
On Tue, 11 Jan 2005, j.random.programmer wrote:
> The postgresql 8 version 308 JDBC driver is broken
> (jar file: pg80b1.308.jdbc3.jar)
>
> The System.out.println gives a stack overflow error because the
> Statement toString() is broken !!
>
> The following code illustrates the problem. I'm amazed that
> Statement.toString() would cause this kind of problem -- aren't the
> driver writers testing toString() methods of various implementation
> classes ?
Apparently not. It's certainly broken, but what would you expect it to
do? PreparedStatement has a real query that it prints, but Statement has
no such information. Would you like it return null? ""? Something else?
Kris Jurka
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Postgres JDBC driver (80b1.308) bug
@ 2005-01-11 22:56 Kris Jurka <books@ejurka.com>
0 siblings, 0 replies; 4+ messages in thread
From: Kris Jurka @ 2005-01-11 22:56 UTC (permalink / raw)
To: j.random.programmer <javadesigner@yahoo.com>; +Cc: pgsql-jdbc
On Tue, 11 Jan 2005, j.random.programmer wrote:
> > Apparently not. It's certainly broken, but what would you expect it
> > to do? PreparedStatement has a real query that it prints, but
> > Statement has no such information. Would you like it return null? ""?
> > Something else?
>
> In earlier versions of the driver, it did something
> like this:
>
> org.postgresql.jdbc3.Jdbc3Statement@c5fde0
>
Seems reasonable. I've restored this behavior.
Kris Jurka
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Postgres JDBC driver (80b1.308) bug
@ 2005-01-12 07:59 Guillaume Cottenceau <gc@mnc.ch>
parent: Kris Jurka <books@ejurka.com>
0 siblings, 0 replies; 4+ messages in thread
From: Guillaume Cottenceau @ 2005-01-12 07:59 UTC (permalink / raw)
To: pgsql-jdbc
Kris Jurka <books 'at' ejurka.com> writes:
> Apparently not. It's certainly broken, but what would you expect it to
> do? PreparedStatement has a real query that it prints, but Statement has
> no such information. Would you like it return null? ""? Something else?
I'd guess we could expect it to return "attribute" information,
e.g. type of scroll etc.
--
Guillaume Cottenceau
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-01-12 07:59 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-11 20:37 Postgres JDBC driver (80b1.308) bug j.random.programmer <javadesigner@yahoo.com>
2005-01-11 21:05 ` Kris Jurka <books@ejurka.com>
2005-01-12 07:59 ` Guillaume Cottenceau <gc@mnc.ch>
2005-01-11 22:56 Re: Postgres JDBC driver (80b1.308) bug Kris Jurka <books@ejurka.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