Re: Problems with question marks in operators (JDBC, ECPG, ...)

Поиск
Список
Период
Сортировка
Искать
От
David G. Johnston
Тема
Re: Problems with question marks in operators (JDBC, ECPG, ...)
Дата
в 16:18:43
Msg-id
CAKFQuwZbb8Z0hhzbmaS3X-GzQxTyG3zB7B6Ygih44di_uy5rBA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Michael Meskes <meskes@postgresql.org>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Robert Haas <robertmhaas@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Robert Haas <robertmhaas@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Andrew Dunstan <andrew@dunslane.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "Greg Sabino Mullane" <greg@turnstep.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "David G. Johnston" <david.g.johnston@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "Greg Sabino Mullane" <greg@turnstep.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "Greg Sabino Mullane" <greg@turnstep.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Jan de Visser <jan@de-visser.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Kevin Grittner <kgrittn@ymail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Tom Lane <tgl@sss.pgh.pa.us>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Andrew Dunstan <andrew@dunslane.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Kevin Grittner <kgrittn@ymail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Tom Lane <tgl@sss.pgh.pa.us>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "David G. Johnston" <david.g.johnston@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Robert Haas <robertmhaas@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "David G. Johnston" <david.g.johnston@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "David G. Johnston" <david.g.johnston@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "Greg Sabino Mullane" <greg@turnstep.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Jan de Visser <jan@de-visser.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Tom Lane <tgl@sss.pgh.pa.us>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Michael Meskes <meskes@postgresql.org>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "David G. Johnston" <david.g.johnston@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Kevin Grittner <kgrittn@ymail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Mike Blackwell <mike.blackwell@rrd.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Mike Blackwell <mike.blackwell@rrd.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Tom Lane <tgl@sss.pgh.pa.us>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Andrew Dunstan <andrew@dunslane.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Mike Blackwell <mike.blackwell@rrd.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "Greg Sabino Mullane" <greg@turnstep.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Tom Lane <tgl@sss.pgh.pa.us>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Michael Meskes <meskes@postgresql.org>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Robert Haas <robertmhaas@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Dave Cramer <pg@fastcrypt.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) "David G. Johnston" <david.g.johnston@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Tom Lane <tgl@sss.pgh.pa.us>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Kevin Grittner <kgrittn@ymail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Jeff Janes <jeff.janes@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Tom Lane <tgl@sss.pgh.pa.us>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Jeff Janes <jeff.janes@gmail.com>
Re: Problems with question marks in operators (JDBC, ECPG, ...) Bruno Harbulot <bruno@distributedmatter.net>
On Wed, May 20, 2015 at 8:29 AM, Bruno Harbulot <bruno@distributedmatter.net> wrote:


On Tue, May 19, 2015 at 10:50 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Tue, May 19, 2015 at 2:34 PM, Bruno Harbulot <bruno@distributedmatter.net> wrote:

While I can imagine a Java PostgreSQL driver that would use the libpq syntax, I can't see it being able to have any useful sort of half-compatibility with JDBC, whether it mimics its interfaces or not. I'm not sure it would be very useful at all, considering how much the existing tooling the the Java world relies on JDBC.


​I won't claim to have studied this in great detail but there is a lot more to the JDBC spec beyond the semantics of "PreparedStatement.parse(String)". No need to throw out the baby with the bath water and reinvent ResultSet, Connection and various other interfaces that are perfectly usable before and after a suitable query has been fully parsed.

When I say "setInteger(1, new Integer(1000))" I don't care whether I had to write "SELECT ? AS int_val" OR "SELECT $1 AS int_val"; though the later has the nice property of providing corresponding numbers so that I would write something like "SELECT $1 AS int_val, $1 AS int_val_2" and not be forced to write "setInteger(2, new Integer(1000))" to pass in a value to the second - but identical - parameter.  Maybe it violates the semantics defined by the API - which I could be making too lightly of - but having the same mechanics involved to solve the same problem - with only minor semantic nuances to remember seems within the realm of reasonable.



Yes, you're probably right. Nevertheless, I'm not sure why anyone would switch to that format, knowing that other tools that are on top of JDBC would certainly not work very well (e.g. Groovy SQL, JOOQ, or ORMs like Hibernate, ...).


​Hadn't really pondered those :(  though to be honest a compatibility layer to write out sequential $# instead of ? doesn't seem that difficult - but it would depend on the codebase of the tool.  Unfortunately the driver wouldn't be in a position to do the work.

David J​
 
В списке pgsql-hackers по дате отправления
От: Jon Nelson
Дата:
От: Andrew Dunstan
Дата:
FAQ