use of io.trino.jdbc.TrinoConnection in project trino by trinodb.
the class TestJdbc method shouldSetLocale.
@Test(groups = JDBC)
public void shouldSetLocale() throws SQLException {
// TODO uew new connection rather than modifying a shared one
((TrinoConnection) connection()).setLocale(CHINESE);
try (Statement statement = connection().createStatement()) {
QueryResult result = queryResult(statement, "SELECT date_format(TIMESTAMP '2001-01-09 09:04', '%M')");
assertThat(result).contains(row("一月"));
}
}
use of io.trino.jdbc.TrinoConnection in project trino by trinodb.
the class JdbcDriverUtils method setSessionProperty.
public static void setSessionProperty(Connection connection, String key, String value) throws SQLException {
@SuppressWarnings("resource") TrinoConnection trinoConnection = connection.unwrap(TrinoConnection.class);
trinoConnection.setSessionProperty(key, value);
}
Aggregations