Re: Change of format of returned flat value after prepareThreshold
От | Vladimir Sitnikov |
---|---|
Тема | Re: Change of format of returned flat value after prepareThreshold |
Дата | |
Msg-id | CAB=Je-F5k+wDDU3V4YE+pSyVK7rDOMmucoQy8wnPK7gFEJeh1g@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Change of format of returned flat value after prepareThreshold (Michał Niklas <michal.niklas@heuthes.pl>) |
Ответы |
Re: Change of format of returned flat value after
prepareThreshold
Re: Change of format of returned flat value after prepareThreshold |
Список | pgsql-jdbc |
> I changed those codes to use System.currentTimeMillis(). >why JDBC or database backend changes format of returned value >after my use count reaches prepareThreshold parameter. We JDBC driver cannot ensure stable string representation of non-string data. That might change as database improves. That might change as JDBC driver improves. >If I set prepareThreshold=5 then I get float in normal >notation up to 5th try, and then from 6th try I get this >value in scientific notation. Well, that is thanks to usage of server-prepared statement. In that mode, pgjdbc can use binary format of data transfer. It does use binary mode for types it knows as it is more efficient to transfer and parse. >I do not observe this with JDBC drivers in version 9.3, The thing is older versions did not manage to use server-prepared statements for prepareStatement(); .call(); Recently pgjdbc learned to use server-prepared statement even in case application does not care to reuse PreparedStatements: http://stackoverflow.com/questions/32297503/whats-the-life-span-of-a-postgresql-server-side-prepared-statement/32300222#32300222 >then I simplified code that now >is even more portable (as we work with other databases) Can you share the code? >but getString() simply works. That is more or less similar to "sun.misc.Unsafe" API. You want string, you get it. I believe there is no specification on what .getString() should look like. Vladimir
В списке pgsql-jdbc по дате отправления: