Discussion:
determining the SQLDialect
Manuel Rossetti
2018-10-17 22:44:22 UTC
Permalink
I have a use case where I don't know the SQLDialect prior to getting a
DLSContext. Is there a way in jooq to determine the SQLDialect, say from a
Connection object?

The DLS.using(connection, dialect) requires the dialect. Is there a way to
determine the dialect prior to this, say from the meta data of the
connection. Is there jooq support for doing this?
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Lukas Eder
2018-10-18 13:19:46 UTC
Permalink
Hi Manuel,

Just don't pass the dialect to DSL.using(connection). jOOQ will auto-detect
from the JDBC connection URL (there are some ambiguities for some databases)

Thanks,
Lukas
Post by Manuel Rossetti
I have a use case where I don't know the SQLDialect prior to getting a
DLSContext. Is there a way in jooq to determine the SQLDialect, say from a
Connection object?
The DLS.using(connection, dialect) requires the dialect. Is there a way
to determine the dialect prior to this, say from the meta data of the
connection. Is there jooq support for doing this?
--
You received this message because you are subscribed to the Google Groups
"jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Manuel Rossetti
2018-10-18 18:55:27 UTC
Permalink
Okay. Is there a way to get the dialect that jOOQ detects? I don't see a
method for this, but it might be somewhere that I don't know about.
Post by Lukas Eder
Hi Manuel,
Just don't pass the dialect to DSL.using(connection). jOOQ will
auto-detect from the JDBC connection URL (there are some ambiguities for
some databases)
Thanks,
Lukas
Post by Manuel Rossetti
I have a use case where I don't know the SQLDialect prior to getting a
DLSContext. Is there a way in jooq to determine the SQLDialect, say from a
Connection object?
The DLS.using(connection, dialect) requires the dialect. Is there a way
to determine the dialect prior to this, say from the meta data of the
connection. Is there jooq support for doing this?
--
You received this message because you are subscribed to the Google Groups
"jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/jooq-user/VdfZt5rZHJQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Lukas Eder
2018-10-18 21:20:18 UTC
Permalink
Internally, jOOQ uses
https://www.jooq.org/javadoc/latest/org/jooq/tools/jdbc/JDBCUtils.html#dialect-java.sql.Connection-
Post by Manuel Rossetti
Okay. Is there a way to get the dialect that jOOQ detects? I don't see a
method for this, but it might be somewhere that I don't know about.
Post by Lukas Eder
Hi Manuel,
Just don't pass the dialect to DSL.using(connection). jOOQ will
auto-detect from the JDBC connection URL (there are some ambiguities for
some databases)
Thanks,
Lukas
Post by Manuel Rossetti
I have a use case where I don't know the SQLDialect prior to getting a
DLSContext. Is there a way in jooq to determine the SQLDialect, say from a
Connection object?
The DLS.using(connection, dialect) requires the dialect. Is there a way
to determine the dialect prior to this, say from the meta data of the
connection. Is there jooq support for doing this?
--
You received this message because you are subscribed to the Google
Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/jooq-user/VdfZt5rZHJQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Manuel Rossetti
2018-10-19 13:53:46 UTC
Permalink
That is good to know. Since it is a guess, can the returned value from

public static final SQLDialect
<https://www.jooq.org/javadoc/latest/org/jooq/SQLDialect.html>
dialect(Connection
<http://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html?is-external=true>
connection)

be null?
Post by Lukas Eder
Internally, jOOQ uses
https://www.jooq.org/javadoc/latest/org/jooq/tools/jdbc/JDBCUtils.html#dialect-java.sql.Connection-
Post by Manuel Rossetti
Okay. Is there a way to get the dialect that jOOQ detects? I don't see
a method for this, but it might be somewhere that I don't know about.
Post by Lukas Eder
Hi Manuel,
Just don't pass the dialect to DSL.using(connection). jOOQ will
auto-detect from the JDBC connection URL (there are some ambiguities for
some databases)
Thanks,
Lukas
Post by Manuel Rossetti
I have a use case where I don't know the SQLDialect prior to getting a
DLSContext. Is there a way in jooq to determine the SQLDialect, say from a
Connection object?
The DLS.using(connection, dialect) requires the dialect. Is there a
way to determine the dialect prior to this, say from the meta data of the
connection. Is there jooq support for doing this?
--
You received this message because you are subscribed to the Google
Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/jooq-user/VdfZt5rZHJQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/jooq-user/VdfZt5rZHJQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Lukas Eder
2018-10-19 14:40:59 UTC
Permalink
No, they will return SQLDialect.DEFAULT, not null. I will fix the Javadoc:
https://github.com/jOOQ/jOOQ/issues/7954
Post by Manuel Rossetti
That is good to know. Since it is a guess, can the returned value from
public static final SQLDialect <https://www.jooq.org/javadoc/latest/org/jooq/SQLDialect.html> dialect(Connection <http://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html?is-external=true> connection)
be null?
Post by Lukas Eder
Internally, jOOQ uses
https://www.jooq.org/javadoc/latest/org/jooq/tools/jdbc/JDBCUtils.html#dialect-java.sql.Connection-
Post by Manuel Rossetti
Okay. Is there a way to get the dialect that jOOQ detects? I don't see
a method for this, but it might be somewhere that I don't know about.
Post by Lukas Eder
Hi Manuel,
Just don't pass the dialect to DSL.using(connection). jOOQ will
auto-detect from the JDBC connection URL (there are some ambiguities for
some databases)
Thanks,
Lukas
Post by Manuel Rossetti
I have a use case where I don't know the SQLDialect prior to getting a
DLSContext. Is there a way in jooq to determine the SQLDialect, say from a
Connection object?
The DLS.using(connection, dialect) requires the dialect. Is there a
way to determine the dialect prior to this, say from the meta data of the
connection. Is there jooq support for doing this?
--
You received this message because you are subscribed to the Google
Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/jooq-user/VdfZt5rZHJQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/jooq-user/VdfZt5rZHJQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...