Skip to content

Commit 8339bf9

Browse files
Merge branch 'main' into timestamp_local_tz_fix
2 parents edca66f + 8754193 commit 8339bf9

16 files changed

+338
-231
lines changed

pom.xml

Lines changed: 135 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,45 @@
2727
<groupId>com.oracle.database.r2dbc</groupId>
2828
<artifactId>oracle-r2dbc</artifactId>
2929
<version>0.1.0</version>
30+
<name>oracle-r2dbc</name>
31+
<description>
32+
Oracle R2DBC Driver implementing version 0.8.2 of the R2DBC SPI for Oracle Database.
33+
</description>
34+
<url>
35+
https://github.com/oracle/oracle-r2dbc
36+
</url>
37+
<inceptionYear>2019</inceptionYear>
38+
<licenses>
39+
<license>
40+
<name>Universal Permissive License v1.0</name>
41+
<url>https://opensource.org/licenses/UPL</url>
42+
</license>
43+
<license>
44+
<name>Apache License, Version 2.0</name>
45+
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
46+
</license>
47+
</licenses>
48+
<developers>
49+
<developer>
50+
<organization>Oracle America, Inc.</organization>
51+
<organizationUrl>http://www.oracle.com</organizationUrl>
52+
</developer>
53+
</developers>
54+
<scm>
55+
<url>https://github.com/oracle/oracle-r2dbc.git</url>
56+
<connection>
57+
scm:git:https://github.com/oracle/oracle-r2dbc.git
58+
</connection>
59+
<developerConnection>scm:git:git@github.com:oracle/oracle-r2dbc.git</developerConnection>
60+
</scm>
61+
<issueManagement>
62+
<system>GitHub</system>
63+
<url>https://github.com/oracle/oracle-r2dbc/issues</url>
64+
</issueManagement>
3065

3166
<properties>
3267
<java.version>11</java.version>
68+
<ojdbc.version>21.1.0.0</ojdbc.version>
3369
<r2dbc.version>0.8.2.RELEASE</r2dbc.version>
3470
<reactor.version>3.3.0.RELEASE</reactor.version>
3571
<reactive-streams.version>1.0.3</reactive-streams.version>
@@ -52,19 +88,67 @@
5288
<arg>-Xlint:-serial</arg>
5389
</compilerArgs>
5490
<showWarnings>true</showWarnings>
55-
<source>${java.version}</source>
56-
<target>${java.version}</target>
91+
<release>${java.version}</release>
5792
</configuration>
5893
</plugin>
94+
<plugin>
95+
<groupId>org.apache.maven.plugins</groupId>
96+
<artifactId>maven-jar-plugin</artifactId>
97+
<version>3.2.0</version>
98+
<configuration>
99+
<archive>
100+
<manifestEntries>
101+
<Implementation-Title>Oracle R2DBC</Implementation-Title>
102+
<Implementation-Version>
103+
${project.version}
104+
</Implementation-Version>
105+
<Implementation-Vendor>Oracle Corporation</Implementation-Vendor>
106+
<Specification-Title>
107+
R2DBC - Reactive Relational Database Connectivity
108+
</Specification-Title>
109+
<Specification-Version>${r2dbc.version}</Specification-Version>
110+
<Specification-Vendor>
111+
Pivotal Software, Inc
112+
</Specification-Vendor>
113+
<Build-Info>
114+
Oracle R2DBC ${project.version} compiled with JDK ${java.vm.version} from ${java.vm.vendor} on ${maven.build.timestamp}
115+
</Build-Info>
116+
<Main-Class>
117+
oracle.r2dbc.impl.Main
118+
</Main-Class>
119+
</manifestEntries>
120+
</archive>
121+
</configuration>
122+
</plugin>
123+
<plugin>
124+
<groupId>org.apache.maven.plugins</groupId>
125+
<artifactId>maven-source-plugin</artifactId>
126+
<version>3.2.1</version>
127+
</plugin>
59128
<plugin>
60129
<groupId>org.apache.maven.plugins</groupId>
61130
<artifactId>maven-deploy-plugin</artifactId>
62-
<version>2.8.2</version>
131+
<version>3.0.0-M1</version>
132+
</plugin>
133+
<plugin>
134+
<groupId>org.apache.maven.plugins</groupId>
135+
<artifactId>maven-install-plugin</artifactId>
136+
<version>3.0.0-M1</version>
137+
</plugin>
138+
<plugin>
139+
<groupId>org.apache.maven.plugins</groupId>
140+
<artifactId>maven-clean-plugin</artifactId>
141+
<version>3.1.0</version>
142+
</plugin>
143+
<plugin>
144+
<groupId>org.apache.maven.plugins</groupId>
145+
<artifactId>maven-resources-plugin</artifactId>
146+
<version>3.2.0</version>
63147
</plugin>
64148
<plugin>
65149
<groupId>org.apache.maven.plugins</groupId>
66150
<artifactId>maven-surefire-plugin</artifactId>
67-
<version>2.22.2</version>
151+
<version>3.0.0-M5</version>
68152
<configuration>
69153
<includes>
70154
<include>**/*Test.java</include>
@@ -77,7 +161,7 @@
77161
<artifactId>maven-javadoc-plugin</artifactId>
78162
<version>3.2.0</version>
79163
<configuration>
80-
<header>Oracle R2DBC ${version}</header>
164+
<header>Oracle R2DBC ${project.version}</header>
81165
<footer>
82166
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
83167
</footer>
@@ -102,16 +186,7 @@
102186
</configuration>
103187
</plugin>
104188
</plugins>
105-
<directory>${project.basedir}/target</directory>
106-
<outputDirectory>${project.build.directory}/classes</outputDirectory>
107-
<finalName>${project.artifactId}-${project.version}</finalName>
108-
<testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
109-
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
110-
<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
111189
<resources>
112-
<resource>
113-
<directory>${project.basedir}/src/main/resources</directory>
114-
</resource>
115190
<resource>
116191
<directory>${project.basedir}</directory>
117192
<includes>
@@ -122,11 +197,6 @@
122197
<targetPath>META-INF</targetPath>
123198
</resource>
124199
</resources>
125-
<testResources>
126-
<testResource>
127-
<directory>${project.basedir}/src/test/resources</directory>
128-
</testResource>
129-
</testResources>
130200
</build>
131201

132202
<dependencies>
@@ -139,7 +209,7 @@
139209
<dependency>
140210
<groupId>com.oracle.database.jdbc</groupId>
141211
<artifactId>ojdbc11</artifactId>
142-
<version>21.1.0.0</version>
212+
<version>${ojdbc.version}</version>
143213
</dependency>
144214
<dependency>
145215
<groupId>io.projectreactor</groupId>
@@ -186,6 +256,51 @@
186256

187257
</dependencies>
188258

259+
<profiles>
260+
<profile>
261+
<id>publication</id>
262+
<activation>
263+
<property>
264+
<name>release</name>
265+
</property>
266+
</activation>
267+
<build>
268+
<plugins>
269+
<plugin>
270+
<groupId>org.apache.maven.plugins</groupId>
271+
<artifactId>maven-javadoc-plugin</artifactId>
272+
<executions>
273+
<execution>
274+
<id>attach-javadocs</id>
275+
<goals>
276+
<goal>jar</goal>
277+
</goals>
278+
<configuration>
279+
<attach>true</attach>
280+
</configuration>
281+
</execution>
282+
</executions>
283+
</plugin>
284+
<plugin>
285+
<groupId>org.apache.maven.plugins</groupId>
286+
<artifactId>maven-source-plugin</artifactId>
287+
<executions>
288+
<execution>
289+
<id>attach-sources</id>
290+
<goals>
291+
<goal>jar</goal>
292+
</goals>
293+
<configuration>
294+
<attach>true</attach>
295+
</configuration>
296+
</execution>
297+
</executions>
298+
</plugin>
299+
</plugins>
300+
</build>
301+
</profile>
302+
</profiles>
303+
189304
</project>
190305

191306
<!--

sample/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Oracle R2DBC code examples
2-
A simple R2DBC program that connects to ADB and executes a query
2+
A simple R2DBC program that connects to Autonomous Database and executes a query
33

44
# Building manually
55

src/main/java/module-info.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
3+
4+
This software is dual-licensed to you under the Universal Permissive License
5+
(UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License
6+
2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
7+
either license.
8+
9+
Licensed under the Apache License, Version 2.0 (the "License");
10+
you may not use this file except in compliance with the License.
11+
You may obtain a copy of the License at
12+
13+
https://www.apache.org/licenses/LICENSE-2.0
14+
15+
Unless required by applicable law or agreed to in writing, software
16+
distributed under the License is distributed on an "AS IS" BASIS,
17+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
See the License for the specific language governing permissions and
19+
limitations under the License.
20+
*/
21+
/**
22+
* Implements the R2DBC SPI for Oracle Database.
23+
*
24+
* @provides io.r2dbc.spi.ConnectionFactoryProvider
25+
* @since 0.1.0
26+
*/
27+
module com.oracle.database.r2dbc {
28+
29+
provides io.r2dbc.spi.ConnectionFactoryProvider
30+
with oracle.r2dbc.impl.OracleConnectionFactoryProviderImpl;
31+
32+
requires java.sql;
33+
34+
requires ojdbc11;
35+
requires org.reactivestreams;
36+
requires reactor.core;
37+
requires r2dbc.spi;
38+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
3+
4+
This software is dual-licensed to you under the Universal Permissive License
5+
(UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License
6+
2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
7+
either license.
8+
9+
Licensed under the Apache License, Version 2.0 (the "License");
10+
you may not use this file except in compliance with the License.
11+
You may obtain a copy of the License at
12+
13+
https://www.apache.org/licenses/LICENSE-2.0
14+
15+
Unless required by applicable law or agreed to in writing, software
16+
distributed under the License is distributed on an "AS IS" BASIS,
17+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
See the License for the specific language governing permissions and
19+
limitations under the License.
20+
*/
21+
22+
package oracle.r2dbc.impl;
23+
24+
import java.io.IOException;
25+
import java.io.InputStream;
26+
import java.util.Objects;
27+
import java.util.jar.Manifest;
28+
29+
/**
30+
* <p>
31+
* A public class implementing a main method that may be executed from a
32+
* command line. This class is specified as the Main-Class attribute in
33+
* the META-INF/MANIFEST.MF of the Oracle R2DBC jar.
34+
* </p><p><i>
35+
* The behavior implemented by this class may change between minor and patch
36+
* version release updates.
37+
* </i></p><p>
38+
* The following command, in
39+
* which "x.y.z" is the semantic version number of the jar,
40+
* executes the main method of this class:
41+
* </p><pre>
42+
* java -jar oracle-r2dbc-x.y.z.jar
43+
* </pre><p>
44+
* Since version 0.1.1, the main method is implemented to exit after printing
45+
* a message to the standard output stream. The message includes the version
46+
* numbers of the Oracle R2DBC Driver along with the JDK that compiled it. A
47+
* timestamp captured at the moment when the jar was compiled is also included.
48+
* </p>
49+
*
50+
* @since 0.1.1
51+
* @author Michael-A-McMahon
52+
*/
53+
public final class Main {
54+
55+
private Main() {/*This class has no instance fields*/}
56+
57+
/**
58+
* Prints information about this build of Oracle R2DBC. This method attempts
59+
* to read a "Build-Info" attribute from META-INF/MANIFEST.MF. If the
60+
* manifest is not available to the class loader, or if the manifest does
61+
* not contain a Build-Info attribute, then this method prints a message
62+
* indicating that build information can not be located.
63+
* @param args ignored
64+
* @throws IOException If the META-INF/MANIFEST.MF resource can not be read.
65+
*/
66+
public static void main(String[] args) throws IOException {
67+
68+
InputStream manifestStream =
69+
Main.class.getModule().getResourceAsStream("META-INF/MANIFEST.MF");
70+
71+
if (manifestStream == null) {
72+
System.out.println("META-INF/MANIFEST.MF not found");
73+
return;
74+
}
75+
76+
try (manifestStream) {
77+
System.out.println(Objects.requireNonNullElse(
78+
new Manifest(manifestStream)
79+
.getMainAttributes()
80+
.getValue("Build-Info"),
81+
"Build-Info is missing from the manifest"));
82+
}
83+
}
84+
}

src/main/java/oracle/r2dbc/impl/OracleConnectionImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
import reactor.core.publisher.Mono;
3333

3434
import static java.sql.Connection.TRANSACTION_READ_COMMITTED;
35-
import static java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
36-
import static java.sql.Connection.TRANSACTION_REPEATABLE_READ;
3735
import static java.sql.Connection.TRANSACTION_SERIALIZABLE;
3836
import static oracle.r2dbc.impl.OracleR2dbcExceptions.requireNonNull;
3937
import static oracle.r2dbc.impl.OracleR2dbcExceptions.getOrHandleSQLException;

src/main/java/oracle/r2dbc/impl/OracleReactiveJdbcAdapter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,11 @@ static OracleReactiveJdbcAdapter getInstance() {
419419
@Override
420420
public DataSource createDataSource(ConnectionFactoryOptions options) {
421421

422-
oracle.jdbc.pool.OracleDataSource oracleDataSource =
422+
OracleDataSource oracleDataSource =
423423
getOrHandleSQLException(oracle.jdbc.pool.OracleDataSource::new);
424424

425-
oracleDataSource.setURL(composeJdbcUrl(options));
425+
runOrHandleSQLException(() ->
426+
oracleDataSource.setURL(composeJdbcUrl(options)));
426427
configureStandardOptions(oracleDataSource, options);
427428
configureExtendedOptions(oracleDataSource, options);
428429
configureJdbcDefaults(oracleDataSource);

src/main/java/oracle/r2dbc/impl/OracleResultImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import java.sql.PreparedStatement;
2525
import java.sql.ResultSet;
26-
import java.sql.SQLException;
2726
import java.util.concurrent.atomic.AtomicBoolean;
2827
import java.util.function.BiFunction;
2928

src/main/java/oracle/r2dbc/impl/OracleRowImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.r2dbc.spi.Clob;
2626
import io.r2dbc.spi.R2dbcException;
2727
import io.r2dbc.spi.Row;
28+
2829
import oracle.jdbc.OracleTypes;
2930

3031
import java.nio.ByteBuffer;

0 commit comments

Comments
 (0)