Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
08f61d3
Checking in servlets for UCP
Jul 24, 2017
a44b542
Merge pull request #33 from bjeffrie/master
bjeffrie Apr 10, 2018
93d6c5d
Added code samples under test/
Kuassim Apr 10, 2018
40e6ef5
Merge branch 'master' of https://github.com/oracle/oracle-db-examples
Kuassim Apr 10, 2018
91a9760
Fixed the connect string URL
Kuassim Apr 10, 2018
a363b72
Replaced curly braket with doubled quote
Kuassim Apr 11, 2018
54eddb7
Added ADBA JavaDoc
Kuassim Apr 11, 2018
3054a69
Added part 4 - handling post, put and delete requests
Apr 11, 2018
29ee0b1
Changed Number to parseInt for primitive value
Apr 11, 2018
fc37001
Updated Readme
Kuassim Apr 13, 2018
5535df8
Updated Readme.md
Kuassim Apr 13, 2018
9cc58ab
Updated Readme.md
Kuassim Apr 13, 2018
77996cc
Updated Readme.md
Kuassim Apr 13, 2018
1aef548
Updated the Readme.md
Kuassim Apr 13, 2018
96cfb8d
Merge branch 'master' of https://github.com/oracle/oracle-db-examples
Kuassim Apr 13, 2018
8058676
Readme.md
Kuassim Apr 13, 2018
6e44594
Formatting in Readme.md
Kuassim Apr 13, 2018
b86d122
Formatting in Readme.md
Kuassim Apr 13, 2018
5e7d927
Formatting
Kuassim Apr 13, 2018
27fe2d7
Formatting
Kuassim Apr 13, 2018
9cb5bcc
Fixed formattin typo
Kuassim Apr 13, 2018
f063b0e
Formatting
Kuassim Apr 13, 2018
6b0015c
Space
Kuassim Apr 13, 2018
9c024b0
tidy part0
nigelbayliss Apr 18, 2018
518b1d8
Merge branch 'master' of https://github.com/oracle/oracle-db-examples
nigelbayliss Apr 18, 2018
35bc650
Changes to Connection.java, Operation.java and OperationGroup.java
Kuassim Apr 23, 2018
697dcc8
Merge branch 'master' of https://github.com/oracle/oracle-db-examples
Kuassim Apr 23, 2018
9c14f8e
Added a Derby SQL.
Kuassim Apr 23, 2018
d0e727a
Checking in DataSourceForJKS.java
Apr 23, 2018
449467f
changed the comments
Apr 23, 2018
241443a
Merge pull request #34 from oracle/JKSexample
nsundara Apr 23, 2018
015475c
readme typo
nigelbayliss Apr 25, 2018
d33b143
Merge branch 'master' of https://github.com/oracle/oracle-db-examples
nigelbayliss Apr 25, 2018
1193851
Adding basic code samples
Apr 27, 2018
15f982d
Create Readme.md
nsundara Apr 27, 2018
a979f49
Update Readme.md
nsundara Apr 27, 2018
9d335eb
Update Readme.md
nsundara Apr 27, 2018
2e80e51
Update Readme.md
nsundara Apr 27, 2018
8333a0c
Update Readme.md
nsundara Apr 27, 2018
fcd8861
Update Readme.md
nsundara Apr 27, 2018
d0c1b01
Update Readme.md
nsundara Apr 27, 2018
f1ebc56
Update Readme.md
nsundara Apr 27, 2018
87ee1f4
Update Readme.md
nsundara Apr 27, 2018
c6ef7a4
Update Readme.md
nsundara Apr 27, 2018
78eda29
Update DateTimeStampSample.java
nsundara Apr 27, 2018
5c278c2
Update JSONBasicSample.java
nsundara Apr 27, 2018
8bf115b
Update LobBasicSample.java
nsundara Apr 27, 2018
bb79bd3
Update PLSQLSample.java
nsundara Apr 27, 2018
699ff6b
Update Readme.md
nsundara Apr 27, 2018
bb2f75f
Update Readme.md
nsundara Apr 27, 2018
f2cf012
Update Readme.md
nsundara Apr 27, 2018
5c76f5e
Update Readme.md
nsundara Apr 27, 2018
5393686
Update Readme.md
nsundara Apr 27, 2018
868ab07
Update UCPBasic.java
nsundara Apr 27, 2018
926ce3f
Update UCPHarvesting.java
nsundara Apr 27, 2018
65f9d8c
Update UCPLabeling.java
nsundara Apr 27, 2018
0c8b165
Update UCPManager.java
nsundara Apr 27, 2018
ddcd242
Update UCPManagerMBean.java
nsundara Apr 27, 2018
3ac7c68
Update UCPMaxConnReuse.java
nsundara Apr 27, 2018
a620337
Update UCPMultiUsers.java
nsundara Apr 27, 2018
93d2ed7
Update UCPTimeouts.java
nsundara Apr 27, 2018
bef929e
Merge pull request #38 from oracle/basicsamples
nsundara Apr 27, 2018
40b17ec
Update Readme.md
nsundara Apr 27, 2018
7b556a5
Update Readme.md
nsundara Apr 27, 2018
efb9172
Update Readme.md
nsundara Apr 27, 2018
c12c2e8
Update Readme.md
nsundara Apr 27, 2018
7bbc254
Update Readme.md
nsundara Apr 27, 2018
287835a
Update Readme.md
nsundara Apr 27, 2018
4740a12
Update Readme.md
nsundara Apr 27, 2018
90c1e80
Update Readme.md
nsundara Apr 27, 2018
06ac4c7
Changes to the Readme.md
Kuassim May 1, 2018
bea71c4
Merge branch 'master' of https://github.com/oracle/oracle-db-examples
Kuassim May 1, 2018
3fdcc90
Sandbox URL
Kuassim May 3, 2018
d93003d
Fixed command lines
Kuassim May 3, 2018
98bed61
Page formatting
Kuassim May 3, 2018
9ba7973
Update README.md
nsundara May 3, 2018
9a12bd4
Update README.md
nsundara May 3, 2018
b408c0b
Rename the folder
May 7, 2018
7520984
stats on load
nigelbayliss May 9, 2018
467c880
Merge branch 'master' of https://github.com/oracle/oracle-db-examples
nigelbayliss May 9, 2018
cd65676
rm file
nigelbayliss May 9, 2018
913f7e2
fix scripts
nigelbayliss May 9, 2018
974ed37
fix rm
nigelbayliss May 9, 2018
536f92f
include credit
nigelbayliss May 9, 2018
94a96df
user script
nigelbayliss May 9, 2018
071527a
Update Readme.md
nsundara May 16, 2018
9d03a38
Update Readme.md
nsundara May 16, 2018
f9db629
Update Readme.md
nsundara May 16, 2018
bc027d7
Update Readme.md
nsundara May 16, 2018
02d09fa
stats answering
nigelbayliss May 18, 2018
1e60364
Merge branch 'master' of https://github.com/oracle/oracle-db-examples
nigelbayliss May 18, 2018
5efdcb5
readme
nigelbayliss May 18, 2018
8b42c1f
stats answering
nigelbayliss May 18, 2018
f729b06
include date col
nigelbayliss May 18, 2018
b50402d
readme
nigelbayliss May 18, 2018
3690826
readme
nigelbayliss May 23, 2018
62983d5
Changes to merge UCP with JDBC
May 31, 2018
1ea0dde
Merge pull request #39 from oracle/ucp
nsundara May 31, 2018
c51ec27
Merge UCP with JDBC
May 31, 2018
2fe8b28
Merge pull request #40 from oracle/ucp
nsundara May 31, 2018
5991874
Checking in RefCursorInSample
Jun 1, 2018
964107f
Sync with node-oracledb 2.3 examples (#41)
Jun 8, 2018
99ef520
Hints
nigelbayliss Jun 11, 2018
adce454
Merge branch 'master' of https://github.com/oracle/oracle-db-examples
nigelbayliss Jun 11, 2018
dbc770a
add fk
nigelbayliss Jun 11, 2018
6b4b1e9
low consumer comment
nigelbayliss Jun 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 128 additions & 55 deletions java/AoJ/README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,128 @@
# AoJ: ADBA over JDBC

ADBA is Asynchronous Database Access, a non-blocking database access api that Oracle is proposing as a Java standard. ADBA was announced at [JavaOne 2016](https://static.rainfocus.com/oracle/oow16/sess/1461693351182001EmRq/ppt/CONF1578%2020160916.pdf) and presented again at [JavaOne 2017](http://www.oracle.com/technetwork/database/application-development/jdbc/con1491-3961036.pdf). The ADBA source is available for download from the [OpenJDK sandbox](
http://hg.openjdk.java.net/jdk/sandbox/file/9d3b0eb749a9/src/jdk.incubator.adba) as part of the OpenJDK project. You can get involved in the ADBA specification effort by following the [JDBC Expert Group mailing list](http://mail.openjdk.java.net/pipermail/jdbc-spec-discuss/).

Reading a bunch of JavaDoc and interfaces can be interesting, but it is not nearly as engaging as having actual running code to play with. To that end, we have uploaded the beginnings of an implementation of ADBA running over standard JDBC, AoJ. AoJ is available for download from [GitHub](https://github.com/oracle/oracle-db-examples/tree/master/java/AoJ) under the Apache license. It should run with any reasonably standard compliant JDBC driver.

AoJ implements only a small part of ADBA, but it is enough to write interesting code. It provides partial implementations of DataSourceFactory, DataSource, Connection, OperationGroup, RowOperation, CountOperation, Transaction and others. These implementations are not complete but there is enough there to write interesting database programs. The code that is there is untested, but it does work to some extent. The saving grace is that you can download the source and improve it: add new features, fix bugs, try out alternate implementations.

Oracle is not proposing AoJ as an open source project. However, because AoJ is released under the Apache license, the Java community can fork the code and create a true open source project with this upload as a base. Oracle developers may contribute when we have time, but this would have to be a Java community effort.

We could have held this code back and worked on it longer. Instead we thought it better to get it to the community as soon as we could. We hope that you agree.

## Sample Code

The following test case should give you some idea of what AoJ can do. It uses the scott/tiger [schema](https://github.com/oracle/dotnet-db-samples/blob/master/schemas/scott.sql). It should run with any JDBC driver connecting to a database with the scott schema.

`````` public void transactionSample() {
DataSourceFactory factory = DataSourceFactory.forName("com.oracle.adbaoverjdbc.DataSourceFactory");
try (DataSource ds = factory.builder()
.url(URL)
.username(“scott")
.password(“tiger")
.build();
Connection conn = ds.getConnection(t -> System.out.println("ERROR: " + t.getMessage()))) {
Transaction trans = conn.transaction();
CompletionStage<Integer> idF = conn.<Integer>rowOperation("select empno, ename from emp where ename = ? for update")
.set("1", "CLARK", AdbaType.VARCHAR)
.collect(Collector.of(
() -> new int[1],
(a, r) -> {a[0] = r.get("empno", Integer.class); },
(l, r) -> null,
a -> a[0])
)
.submit()
.getCompletionStage();
conn.<Long>countOperation("update emp set deptno = ? where empno = ?")
.set("1", 50, AdbaType.INTEGER)
.set("2", idF, AdbaType.INTEGER)
.apply(c -> {
if (c.getCount() != 1L) {
trans.setRollbackOnly();
throw new SqlException("updated wrong number of rows", null, null, -1, null, -1);
}
return c.getCount();
})
.onError(t -> t.printStackTrace())
.submit();
conn.catchErrors();
conn.commitMaybeRollback(trans);
}
ForkJoinPool.commonPool().awaitQuiescence(1, TimeUnit.MINUTES);
}


# AoJ: ADBA over JDBC

ADBA is Asynchronous Database Access, a non-blocking database access api that
Oracle is proposing as a Java standard. ADBA was announced at
[JavaOne 2016](https://static.rainfocus.com/oracle/oow16/sess/1461693351182001EmRq/ppt/CONF1578%2020160916.pdf)
and presented again at [JavaOne 2017](http://www.oracle.com/technetwork/database/application-development/jdbc/con1491-3961036.pdf).
The ADBA source is available for download from the [OpenJDK sandbox](http://hg.openjdk.java.net/jdk/sandbox/file/9d3b0eb749a9/src/jdk.incubator.adba)
as part of the OpenJDK project and the JavaDoc is available [here](http://cr.openjdk.java.net/~lancea/8188051/apidoc/jdk.incubator.adba-summary.html).
You can get involved in the ADBA specification effort by following the
[JDBC Expert Group mailing list](http://mail.openjdk.java.net/pipermail/jdbc-spec-discuss/).

Reading a bunch of JavaDoc and interfaces can be interesting, but it is not nearly
as engaging as having actual running code to play with. To that end, we have
uploaded the beginnings of an implementation of ADBA running over standard JDBC,
AoJ. AoJ is available for download from [GitHub](https://github.com/oracle/oracle-db-examples/tree/master/java/AoJ)
under the Apache license. It should run with any reasonably standard compliant
JDBC driver.

AoJ implements only a small part of ADBA, but it is enough to write interesting
code. It provides partial implementations of ```DataSourceFactory```, ```DataSource```,
```Connection```, ```OperationGroup```, ```RowOperation```, ```CountOperation```,
```Transaction``` and others. These implementations are not complete but there is
enough there to write interesting database programs. The code that is there is
untested, but it does work to some extent. The saving grace is that you can
download the source and improve it: add new features, fix bugs, try out alternate
implementations.

Oracle is not proposing AoJ as an open source project. However, because AoJ is
released under the Apache license, the Java community can fork the code and create
a true open source project with this upload as a base. Oracle developers may
contribute when we have time, but this would have to be a Java community effort.

We could have held this code back and worked on it longer. Instead we thought it
better to get it to the community as soon as we could. We hope that you agree.

## Building AoJ

AoJ and ADBA require JDK 9 or later. Download ADBA from the
[OpenJDK sandbox](http://hg.openjdk.java.net/jdk/sandbox/file/JDK-8188051-branch/src/jdk.incubator.adba/share/classes). It does not have any dependencies outside of Java SE.

For building the API modules:
```
$ mkdir -p mods/jdk.incubator.adba
$ javac -d mods/jdk.incubator.adba/ $(find jdk.incubator.adba -name "*.java")
$ jar --create --file=mlib/jdk.incubator.adba.jar --module-version=1.0 -C mods/jdk.incubator.adba/ .
````
Download AoJ from
[GitHub](https://github.com/oracle/oracle-db-examples/tree/master/java/AoJ). Both
are modularized so be sure to include the module-info.java files. AoJ depends on
ADBA. The AoJ sample file depends on JUnit which is included with most IDEs but is
also available [here](https://github.com/junit-team/junit4).

To run the sample file you will need a SQL database and corresponding JDBC driver. AoJ
has been run with [Oracle Database 12c](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html)
and [Oracle Database 12c JDBC](http://www.oracle.com/technetwork/database/application-development/jdbc/downloads/index.html),
but it should work with any reasonably standard compliant SQL database and JDBC
driver. The sample file uses the scott/tiger schema available
[here](https://github.com/oracle/dotnet-db-samples/blob/master/schemas/scott.sql).

Start the database and load ```scott.sql```. Edit ```com.oracle.adbaoverjdbc.test.FirstLight.java```
and set the constant ```URL``` to an appropriate value. AoJ will pass this value
to ```java.sql.DriverManager.getConnection```. If you are using a database other
than Oracle you should change the value of the constant ```TRIVIAL``` to some
very trivial ```SELECT``` query.

## Sample Code

The following test case should give you some idea of what AoJ can do. It should
run with any JDBC driver connecting to a database with the scott schema. This is
the last test in ```com.oracle.adbaoverjdbc.test.FirstLight.java```. For an
introduction to ADBA see the [JavaOne 2017 presentation](http://www.oracle.com/technetwork/database/application-development/jdbc/con1491-3961036.pdf).


```public void transactionSample() {
// get the AoJ DataSourceFactory
DataSourceFactory factory = DataSourceFactory.forName("com.oracle.adbaoverjdbc.DataSourceFactory");
// get a DataSource and a Connection
try (DataSource ds = factory.builder()
.url(URL)
.username(“scott")
.password(“tiger")
.build();
Connection conn = ds.getConnection(t -> System.out.println("ERROR: " + t.getMessage()))) {
// get a Transaction
Transaction trans = conn.transaction();
// select the EMPNO of CLARK
CompletionStage<Integer> idF = conn.<Integer>rowOperation("select empno, ename from emp where ename = ? for update")
.set("1", "CLARK", AdbaType.VARCHAR)
.collect(Collector.of(
() -> new int[1],
(a, r) -> {a[0] = r.get("empno", Integer.class); },
(l, r) -> null,
a -> a[0])
)
.submit()
.getCompletionStage();
// update CLARK to work in department 50
conn.<Long>countOperation("update emp set deptno = ? where empno = ?")
.set("1", 50, AdbaType.INTEGER)
.set("2", idF, AdbaType.INTEGER)
.apply(c -> {
if (c.getCount() != 1L) {
trans.setRollbackOnly();
throw new SqlException("updated wrong number of rows", null, null, -1, null, -1);
}
return c.getCount();
})
.onError(t -> t.printStackTrace())
.submit();

conn.catchErrors(); // resume normal execution if there were any errors
conn.commitMaybeRollback(trans); // commit (or rollback) the transaction
}
// wait for the async tasks to complete before exiting
ForkJoinPool.commonPool().awaitQuiescence(1, TimeUnit.MINUTES);
}
```

## AoJ Design Spec in 100 words or less

The methods called by the user thread create a network
(i.e., [DAG](https://en.wikipedia.org/wiki/Directed_acyclic_graph)) of
```CompletableFuture```s. These ```CompleteableFuture```s asynchronously execute
the synchronous JDBC calls and the result processing code provided by the user
code. By default AoJ uses ```ForkJoinPool.commonPool()``` to execute
```CompletableFuture```s but the user code can provide another ```Executor```.
When the ```Connection``` is submitted the root of the ```CompleteableFuture```
network is completed triggering execution of the rest of the network.
3 changes: 3 additions & 0 deletions java/AoJ/sql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Derby SQL

For use with AoJ (slitghly different from Oracle SQL)
35 changes: 35 additions & 0 deletions java/AoJ/sql/derby.adba copy.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
connect 'jdbc:derby:adbaDB;create=true';
DROP TABLE EMP;
DROP TABLE DEPT;
CREATE TABLE DEPT(DEPTNO NUMERIC(2), DNAME VARCHAR(14), LOC VARCHAR(13), PRIMARY KEY(DEPTNO));
CREATE TABLE EMP(EMPNO NUMERIC(4), ENAME VARCHAR(10), JOB VARCHAR(9), MGR NUMERIC(4), HIREDATE DATE, SAL NUMERIC(7,2), COMM NUMERIC(7,2), DEPTNO NUMERIC(2), PRIMARY KEY(EMPNO), foreign key(DEPTNO) references DEPT);
INSERT INTO DEPT VALUES(10,'ACCOUNTING','NEW YORK');
INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS');
INSERT INTO DEPT VALUES(30,'SALES','CHICAGO');
INSERT INTO DEPT VALUES(40,'OPERATIONS','BOSTON');
INSERT INTO EMP VALUES(7369,'SMITH','CLERK',7902, date('1980-12-17'), 800,NULL,20);
INSERT INTO EMP VALUES(7499,'ALLEN','SALESMAN',7698, date('1981-02-20'), 1600, 300, 30);
INSERT INTO EMP VALUES(7521,'WARD','SALESMAN',7698, date('1981-02-22'), 1250, 500, 30);
INSERT INTO EMP VALUES(7566,'JONES','MANAGER', 7839, date('1981-04-02'), 2975, NULL, 20);
INSERT INTO EMP VALUES(7654,'MARTIN','SALESMAN',7698, date('1981-09-28'), 1250,1400, 30);
INSERT INTO EMP VALUES(7698,'BLAKE','MANAGER',7839, date('1981-05-01'), 2850, NULL, 30);
INSERT INTO EMP VALUES(7782,'CLARK','MANAGER',7839, date('1981-06-05'), 2450, NULL, 10);
INSERT INTO EMP VALUES(7788,'SCOTT','ANALYST',7566, date('1987-07-13'), 3000, NULL, 20);
INSERT INTO EMP VALUES(7839,'KING','PRESIDENT',NULL, date('1981-11-17'), 5000, NULL, 10);

INSERT INTO EMP VALUES(7844,'TURNER','SALESMAN',7698, date('1981-09-08'), 1500, 0, 30);
INSERT INTO EMP VALUES(7876,'ADAMS','CLERK',7788, date('1987-07-13'), 1100, NULL, 20);
INSERT INTO EMP VALUES(7900,'JAMES','CLERK',7698, date('1981-12-03'), 950, NULL, 30);
INSERT INTO EMP VALUES(7902,'FORD','ANALYST',7566, date('1981-12-03'), 3000, NULL, 20);
INSERT INTO EMP VALUES(7934,'MILLER','CLERK',7782, date('1982-01-23'), 1300, NULL, 10);

DROP TABLE BONUS;;
CREATE TABLE BONUS(ENAME VARCHAR(10), JOB VARCHAR(9) ,SAL NUMERIC(7,2),COMM NUMERIC(7,2)) ;
DROP TABLE SALGRADE;
CREATE TABLE SALGRADE( GRADE NUMERIC,LOSAL NUMERIC(7,2),HISAL NUMERIC(7,2));

INSERT INTO SALGRADE VALUES (1,700,1200);
INSERT INTO SALGRADE VALUES (2,1201,1400);
INSERT INTO SALGRADE VALUES (3,1401,2000);
INSERT INTO SALGRADE VALUES (4,2001,3000);
INSERT INTO SALGRADE VALUES (5,3001,9999);
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,22 @@ jdk.incubator.sql2.Submission<Object> submit(com.oracle.adbaoverjdbc.Operation<O
}
}

protected <V> V connectionPropertyValue(ConnectionProperty prop) {
V value = (V)properties.get(prop);
if (value == null) return (V)prop.defaultValue();
else return value;
}




// JDBC operations. These are all blocking

private Void jdbcConnect(com.oracle.adbaoverjdbc.Operation<Void> op) {
try {
Properties info = (Properties) ((Properties) properties.get(JdbcConnectionProperties.JDBC_CONNECTION_PROPERTIES)).clone();
Properties info = (Properties)properties.get(JdbcConnectionProperties.JDBC_CONNECTION_PROPERTIES);
info = (Properties)(info == null ? JdbcConnectionProperties.JDBC_CONNECTION_PROPERTIES.defaultValue()
: info.clone());
info.setProperty("user", (String) properties.get(AdbaConnectionProperty.USER));
info.setProperty("password", (String) properties.get(AdbaConnectionProperty.PASSWORD));
String url = (String) properties.get(AdbaConnectionProperty.URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,20 @@ abstract class Operation<T> implements jdk.incubator.sql2.Operation<T> {
private static final Map<Class, SQLType> CLASS_TO_JDBCTYPE = new HashMap<>(20);
static {
try {
CLASS_TO_JDBCTYPE.put(Boolean.class, JDBCType.BOOLEAN);
CLASS_TO_JDBCTYPE.put(BigInteger.class, JDBCType.BIGINT);
CLASS_TO_JDBCTYPE.put(Class.forName("[B"), JDBCType.BINARY);
CLASS_TO_JDBCTYPE.put(Boolean.class, JDBCType.BIT);
CLASS_TO_JDBCTYPE.put(Boolean.class, JDBCType.BOOLEAN);
CLASS_TO_JDBCTYPE.put(Byte.class, JDBCType.TINYINT);
CLASS_TO_JDBCTYPE.put(Class.forName("[B"), JDBCType.VARBINARY);
CLASS_TO_JDBCTYPE.put(Character.class, JDBCType.CHAR);
CLASS_TO_JDBCTYPE.put(LocalDate.class, JDBCType.DATE);
CLASS_TO_JDBCTYPE.put(Double.class, JDBCType.DOUBLE);
CLASS_TO_JDBCTYPE.put(Float.class, JDBCType.FLOAT);
CLASS_TO_JDBCTYPE.put(Integer.class, JDBCType.INTEGER);
CLASS_TO_JDBCTYPE.put(Float.class, JDBCType.REAL);
CLASS_TO_JDBCTYPE.put(Short.class, JDBCType.SMALLINT);
CLASS_TO_JDBCTYPE.put(LocalTime.class, JDBCType.TIME);
CLASS_TO_JDBCTYPE.put(LocalDate.class, JDBCType.DATE);
CLASS_TO_JDBCTYPE.put(LocalDateTime.class, JDBCType.TIMESTAMP);
CLASS_TO_JDBCTYPE.put(OffsetTime.class, JDBCType.TIME_WITH_TIMEZONE);
CLASS_TO_JDBCTYPE.put(LocalTime.class, JDBCType.TIME);
CLASS_TO_JDBCTYPE.put(OffsetDateTime.class, JDBCType.TIMESTAMP_WITH_TIMEZONE);
CLASS_TO_JDBCTYPE.put(Byte.class, JDBCType.TINYINT);
CLASS_TO_JDBCTYPE.put(Class.forName("[byte"), JDBCType.VARBINARY);
CLASS_TO_JDBCTYPE.put(OffsetTime.class, JDBCType.TIME_WITH_TIMEZONE);
CLASS_TO_JDBCTYPE.put(Short.class, JDBCType.SMALLINT);
CLASS_TO_JDBCTYPE.put(String.class, JDBCType.VARCHAR);
}
catch (ClassNotFoundException ex) { /* should never happen */ }
Expand All @@ -88,9 +84,9 @@ abstract class Operation<T> implements jdk.incubator.sql2.Operation<T> {
ADBATYPE_TO_JDBCTYPE.put(AdbaType.FLOAT, JDBCType.FLOAT);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.INTEGER, JDBCType.INTEGER);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.JAVA_OBJECT, JDBCType.JAVA_OBJECT);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.LONGNVARCHAR, JDBCType.LONGNVARCHAR);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.LONGVARBINARY, JDBCType.LONGVARBINARY);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.LONGVARCHAR, JDBCType.LONGVARBINARY);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.LONG_NVARCHAR, JDBCType.LONGNVARCHAR);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.LONG_VARBINARY, JDBCType.LONGVARBINARY);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.LONG_VARCHAR, JDBCType.LONGVARBINARY);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.NCHAR, JDBCType.NCHAR);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.NCLOB, JDBCType.NCLOB);
ADBATYPE_TO_JDBCTYPE.put(AdbaType.NULL, JDBCType.NULL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
package com.oracle.adbaoverjdbc;

import jdk.incubator.sql2.ArrayCountOperation;
import jdk.incubator.sql2.DynamicMultiOperation;
import jdk.incubator.sql2.LocalOperation;
import jdk.incubator.sql2.OutOperation;
import jdk.incubator.sql2.ParameterizedCountOperation;
import jdk.incubator.sql2.ParameterizedRowOperation;
import jdk.incubator.sql2.RowProcessorOperation;
import jdk.incubator.sql2.StaticMultiOperation;
import jdk.incubator.sql2.Submission;
import jdk.incubator.sql2.Transaction;
import jdk.incubator.sql2.TransactionOutcome;
Expand All @@ -34,6 +32,7 @@
import java.util.function.Consumer;
import java.util.logging.Logger;
import java.util.stream.Collector;
import jdk.incubator.sql2.MultiOperation;

/**
* Only sequential, dependent, unconditional supported.
Expand Down Expand Up @@ -205,13 +204,7 @@ public <R extends S> RowProcessorOperation<R> rowProcessorOperation(String sql)
}

@Override
public <R extends S> StaticMultiOperation<R> staticMultiOperation(String sql) {
if ( ! isHeld() ) throw new IllegalStateException("TODO");
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

@Override
public <R extends S> DynamicMultiOperation<R> dynamicMultiOperation(String sql) {
public <R extends S> MultiOperation<R> multiOperation(String sql) {
if ( ! isHeld() ) throw new IllegalStateException("TODO");
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
Expand Down
Loading