comparison src/main/java/org/monetdb/jdbc/MonetDriver.java @ 852:d9a45743536d monetdbs

Merge 'default' into 'monetdbs'
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Fri, 05 Jan 2024 12:45:48 +0100 (16 months ago)
parents 5aa19bbed0d6 e890195256ac
children 676725ad17b5
comparison
equal deleted inserted replaced
851:157dcb2d6516 852:d9a45743536d
1 /* 1 /*
2 * SPDX-License-Identifier: MPL-2.0
3 *
2 * This Source Code Form is subject to the terms of the Mozilla Public 4 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 * 7 *
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V. 8 * Copyright 2024 MonetDB Foundation;
9 * Copyright August 2008 - 2023 MonetDB B.V.;
10 * Copyright 1997 - July 2008 CWI.
7 */ 11 */
8 12
9 package org.monetdb.jdbc; 13 package org.monetdb.jdbc;
10 14
11 import org.monetdb.mcl.net.Target; 15 import org.monetdb.mcl.net.Target;
109 * 113 *
110 * @return this driver's major version number 114 * @return this driver's major version number
111 */ 115 */
112 @Override 116 @Override
113 public int getMajorVersion() { 117 public int getMajorVersion() {
114 // defer to the static version of this method 118 return MonetVersion.majorVersion;
115 return getDriverMajorVersion();
116 } 119 }
117 120
118 /** 121 /**
119 * Gets the driver's minor version number. Initially this should be 0. 122 * Gets the driver's minor version number. Initially this should be 0.
120 * 123 *
121 * @return this driver's minor version number 124 * @return this driver's minor version number
122 */ 125 */
123 @Override 126 @Override
124 public int getMinorVersion() { 127 public int getMinorVersion() {
125 // defer to the static version of this method 128 return MonetVersion.minorVersion;
126 return getDriverMinorVersion();
127 } 129 }
128 130
129 /** 131 /**
130 * Gets information about the possible properties for this driver. 132 * Gets information about the possible properties for this driver.
131 * 133 *
252 throw MonetWrapper.newSQLFeatureNotSupportedException("getParentLogger"); 254 throw MonetWrapper.newSQLFeatureNotSupportedException("getParentLogger");
253 } 255 }
254 256
255 //== end methods of interface driver 257 //== end methods of interface driver
256 258
257
258 /**
259 * Get MonetDB JDBC Driver major version number
260 * method called by MonetDatabaseMetaData methods
261 * @return MonetDB JDBC Driver major version number
262 */
263 static final int getDriverMajorVersion() {
264 // defer to the generated MonetVersion class
265 return MonetVersion.majorVersion;
266 }
267
268 /**
269 * Get MonetDB JDBC Driver minor version number
270 * method called by MonetDatabaseMetaData methods
271 * @return MonetDB JDBC Driver minor version number
272 */
273 static final int getDriverMinorVersion() {
274 // defer to the generated MonetVersion class
275 return MonetVersion.minorVersion;
276 }
277 259
278 /** 260 /**
279 * Returns a touched up identifying version string of this driver. 261 * Returns a touched up identifying version string of this driver.
280 * It is made public as it is called from org/monetdb/client/JdbcClient.java 262 * It is made public as it is called from org/monetdb/client/JdbcClient.java
281 * @return the version string 263 * @return the version string
384 /* case Types.LONGVARBINARY: // MonetDB doesn't use type LONGVARBINARY */ 366 /* case Types.LONGVARBINARY: // MonetDB doesn't use type LONGVARBINARY */
385 return byte[].class; 367 return byte[].class;
386 case Types.DATE: 368 case Types.DATE:
387 return java.sql.Date.class; 369 return java.sql.Date.class;
388 case Types.TIME: 370 case Types.TIME:
371 return java.sql.Time.class;
389 case Types.TIME_WITH_TIMEZONE: 372 case Types.TIME_WITH_TIMEZONE:
390 return java.sql.Time.class; 373 return java.time.OffsetTime.class;
391 case Types.TIMESTAMP: 374 case Types.TIMESTAMP:
375 return java.sql.Timestamp.class;
392 case Types.TIMESTAMP_WITH_TIMEZONE: 376 case Types.TIMESTAMP_WITH_TIMEZONE:
393 return java.sql.Timestamp.class; 377 return java.time.OffsetDateTime.class;
394 case Types.CLOB: 378 case Types.CLOB:
395 return java.sql.Clob.class; 379 return java.sql.Clob.class;
396 case Types.BLOB: 380 case Types.BLOB:
397 return java.sql.Blob.class; 381 return java.sql.Blob.class;
398 382