You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I change the last line to <pgsql.version>42.2.0.jre7</pgsql.version> and recompile my WAR-file, then the Java code -
String SQL_MERGE_USERS = "SELECT words_merge_users(?::jsonb, ?::inet, ?::text, ?::text, ?::text)";
// the next line in MyListener.java throws the exception
try (Connection db = DriverManager.getConnection(DATABASE_URL, DATABASE_USER, DATABASE_PASS);
PreparedStatement st = db.prepareStatement(SQL_MERGE_USERS)) {
st.setString(1, users);
st.setString(2, ip);
st.setString(3, fcm);
st.setString(4, apns);
st.setString(5, adm);
ResultSet rs = st.executeQuery();
throws an exception:
WARNING: SQLException occurred while connecting to 127.0.0.1:6432
org.postgresql.util.PSQLException: The server's DateStyle parameter was changed to ISO. The JDBC driver requires DateStyle to begin with ISO for correct operation.
at org.postgresql.core.v3.QueryExecutorImpl.receiveParameterStatus(QueryExecutorImpl.java:2603)
at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2569)
at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:131)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:212)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:452)
at org.postgresql.Driver.connect(Driver.java:254)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at de.slova.websockets.MyListener.mergeUsers(MyListener.java:152)
at de.slova.websockets.MyListener.handleLogin(MyListener.java:208)
at de.slova.websockets.MyListener.onWebSocketText(MyListener.java:83)
at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextMessage(JettyListenerEventDriver.java:189)
at org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69)
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:66)
at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextFrame(JettyListenerEventDriver.java:158)
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:162)
at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:375)
at org.eclipse.jetty.websocket.common.extensions.AbstractExtension.nextIncomingFrame(AbstractExtension.java:182)
at org.eclipse.jetty.websocket.common.extensions.compress.PerMessageDeflateExtension.nextIncomingFrame(PerMessageDeflateExtension.java:105)
at org.eclipse.jetty.websocket.common.extensions.compress.CompressExtension.forwardIncoming(CompressExtension.java:142)
at org.eclipse.jetty.websocket.common.extensions.compress.PerMessageDeflateExtension.incomingFrame(PerMessageDeflateExtension.java:85)
at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:220)
at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)
at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:256)
at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:679)
at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:511)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)
at java.lang.Thread.run(Thread.java:745)
However I do have datestyle setting in my postgresql.conf:
datestyle = 'iso, mdy'
and I can see it at the console:
# psql
psql (9.6.6)
Type "help" for help.
words=> show datestyle;
DateStyle
-----------
ISO, MDY
(1 row)
I.e. my datestyle setting (unchanged from stock installation) does begin with "ISO" as the exception wants it too.
The text was updated successfully, but these errors were encountered:
vlsi
added a commit
to vlsi/pgjdbc
that referenced
this issue
Jan 20, 2018
Default PostgreSQL configuration is DateStyle='iso, dmy',
however just iso would be fine.
Note: PostgreSQL prints DateStyle value in upper case, and toUpperCase
was added just in case.
fixespgjdbc#1080
Default PostgreSQL configuration is DateStyle='iso, dmy', however pgjdbc should not raise errors
if DateStyle is just ISO
Note: PostgreSQL prints DateStyle value in upper case, and toUpperCase
was added just in case.
fixes#1080
Hello and thank you for developing this software.
There seems to be a bug in the version 42.2.0.jre7 though:
I use Jetty 9.4.7 on CentOS 7.4 with PostgreSQL 9.6.6 with pgbouncer and postgresql-jdbc-4.2.0:
I run a WAR file in Jetty, compiled as following:
When I change the last line to
<pgsql.version>42.2.0.jre7</pgsql.version>
and recompile my WAR-file, then the Java code -throws an exception:
However I do have datestyle setting in my postgresql.conf:
datestyle = 'iso, mdy'
and I can see it at the console:
I.e. my datestyle setting (unchanged from stock installation) does begin with "ISO" as the exception wants it too.
The text was updated successfully, but these errors were encountered: