Mercurial > hg > monetdb-java
comparison src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java @ 430:3924a8516d7b
Refactor MonetDatabaseMetaData.getClientInfoProperties
Use VALUES instead of a UNION of SELECTs
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Mon, 08 Feb 2021 14:29:13 +0100 (2021-02-08) |
parents | e79bfbd0553e |
children | 2558a6178419 |
comparison
equal
deleted
inserted
replaced
429:e4e104f8146c | 430:3924a8516d7b |
---|---|
3732 */ | 3732 */ |
3733 @Override | 3733 @Override |
3734 public ResultSet getClientInfoProperties() throws SQLException { | 3734 public ResultSet getClientInfoProperties() throws SQLException { |
3735 // for a list of connection properties see also MonetConnection.java constructor MonetConnection(Properties props) | 3735 // for a list of connection properties see also MonetConnection.java constructor MonetConnection(Properties props) |
3736 final String query = | 3736 final String query = |
3737 "SELECT 'host' AS \"NAME\", cast(1024 as int) AS \"MAX_LEN\", 'localhost' AS \"DEFAULT_VALUE\", 'DSN or IP-address of machine running MonetDB' AS \"DESCRIPTION\" UNION ALL " + | 3737 "SELECT * FROM (VALUES\n" + |
3738 "SELECT 'port', 5, '50000', 'communication port number of MonetDB server process' UNION ALL " + | 3738 " ('host', cast(1024 as int), 'localhost', 'DSN or IP-address of machine running MonetDB'),\n" + |
3739 "SELECT 'user', 1024, '', 'user name to login to MonetDB server' UNION ALL " + | 3739 " ('port', 5, '50000', 'communication port number of MonetDB server process'),\n" + |
3740 "SELECT 'password', 128, '', 'password for user name to login to MonetDB server' UNION ALL " + | 3740 " ('user', 1024, '', 'user name to login to MonetDB server'),\n" + |
3741 "SELECT 'language', 16, 'sql', 'language (sql or mal) used to parse commands in MonetDB server' UNION ALL " + | 3741 " ('password', 128, '', 'password for user name to login to MonetDB server'),\n" + |
3742 "SELECT 'database', 1024, 'demo', 'name of database. It matches the dbfarm subdirectory name' UNION ALL " + | 3742 " ('language', 16, 'sql', 'language (sql or mal) used to parse commands in MonetDB server'),\n" + |
3743 "SELECT 'debug', 5, 'false', 'boolean flag true or false' UNION ALL " + | 3743 " ('database', 1024, 'demo', 'name of database. It matches the dbfarm subdirectory name'),\n" + |
3744 "SELECT 'logfile', 1024, 'monet_######.log', 'name of logfile used when debug is enabled' UNION ALL " + | 3744 " ('debug', 5, 'false', 'boolean flag true or false'),\n" + |
3745 "SELECT 'hash', 128, '', 'hash methods list to use in server connection. Supported are SHA512, SHA384, SHA256 and SHA1' UNION ALL " + | 3745 " ('logfile', 1024, 'monet_######.log', 'name of logfile used when debug is enabled'),\n" + |
3746 "SELECT 'treat_blob_as_binary', 5, 'true', 'should blob columns be mapped to Types.VARBINARY instead of default Types.BLOB in ResultSets and PreparedStatements' UNION ALL " + | 3746 " ('hash', 128, '', 'hash methods list to use in server connection. Supported are SHA512, SHA384, SHA256 and SHA1'),\n" + |
3747 "SELECT 'treat_clob_as_varchar', 5, 'true', 'should clob columns be mapped to Types.VARCHAR instead of default Types.CLOB in ResultSets and PreparedStatements' UNION ALL " + | 3747 " ('treat_blob_as_binary', 5, 'true', 'should blob columns be mapped to Types.VARBINARY instead of default Types.BLOB in ResultSets and PreparedStatements'),\n" + |
3748 "SELECT 'so_timeout', 10, '0', 'timeout (in milliseconds) of communication socket. 0 means no timeout is set' " + | 3748 " ('treat_clob_as_varchar', 5, 'true', 'should clob columns be mapped to Types.VARCHAR instead of default Types.CLOB in ResultSets and PreparedStatements'),\n" + |
3749 "ORDER BY \"NAME\""; | 3749 " ('so_timeout', 10, '0', 'timeout (in milliseconds) of communication socket. 0 means no timeout is set')\n" + |
3750 ") AS t(\"NAME\", \"MAX_LEN\", \"DEFAULT_VALUE\", \"DESCRIPTION\")\n" + | |
3751 "ORDER BY \"NAME\""; | |
3752 | |
3750 | 3753 |
3751 return executeMetaDataQuery(query); | 3754 return executeMetaDataQuery(query); |
3752 } | 3755 } |
3753 | 3756 |
3754 /** | 3757 /** |