Skip to content

Commit

Permalink
Update saved code to 9.3 branch (following delete)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndepomereu committed Mar 2, 2023
1 parent a993808 commit fdbd2d4
Show file tree
Hide file tree
Showing 201 changed files with 774 additions and 279 deletions.
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

# AceQL HTTP

## AceQL Client JDBC Driver v9.2 - User Guide
## AceQL Client JDBC Driver v9.3 - User Guide

## November 25, 2022
## February 24, 2023

<img src="https://docs.aceql.com/img/AceQL-Schema-min.jpg" alt="AceQL Draw"/>

Expand Down Expand Up @@ -82,11 +82,18 @@ The only required third party installation is a recent JVM:

## AceQL Server side compatibility

The Client JDBC Driver version is compatible with AceQL HTTP server side v6.2+. Batch commands usage require AceQL HTTP server side v8.0+.
The Client JDBC Driver version is compatible with AceQL HTTP server side v6.2+.

But the following features require AceQL HTTP server side v12.2+:

- Stored Procedures Calls.
- Batch management.
- Remote database metadata info fetch.
- Server health info & limits info.

### Main features

| AceQL Client JDBC Driver v9.2<br>Main Features |
| AceQL Client JDBC Driver v9.3<br>Main Features |
| :----------------------------------------------------------- |
| <img src="https://download.aceql.com/images/check_20.png" alt="check!"/>&nbsp;Works as a real [JDBC Driver](https://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html) <br/>Plug & play without editing your app source code. |
| <img src="https://download.aceql.com/images/check_20.png" alt="check!"/>&nbsp;Main SQL types<br/>`Boolean`, `Integer`, `Short`, `Double`, `Float`, `BigDecimal`, `Long`, `String`, `Date`, `Time`, `Timestamp` |
Expand All @@ -113,7 +120,7 @@ The Client JDBC Driver version is compatible with AceQL HTTP server side v6.2+.
<dependency>
<groupId>com.aceql</groupId>
<artifactId>aceql-http-client-jdbc-driver</artifactId>
<version>9.2</version>
<version>9.3</version>
</dependency>
```
### Single Jar
Expand Down Expand Up @@ -171,7 +178,7 @@ Note that AceQL is optimized as much as possible:

We will use the same `sampledb` database for all our code samples.

The schema is available here: [sampledb.txt](https://docs.aceql.com/rest/soft_java_client/9.2/src/sampledb.txt).
The schema is available here: [sampledb.txt](https://docs.aceql.com/rest/soft_java_client/9.3/src/sampledb.txt).

## Connection creation

Expand Down Expand Up @@ -233,7 +240,7 @@ Sample code:

## Handling Exceptions

Except for `NullPointerException`, exceptions thrown are always an instance of [AceQLException.](https://docs.aceql.com/rest/soft_java_client/9.2/javadoc/com/aceql/jdbc/commons/AceQLConnection.html)
Except for `NullPointerException`, exceptions thrown are always an instance of [AceQLException.](https://docs.aceql.com/rest/soft_java_client/9.3/javadoc/com/aceql/jdbc/commons/AceQLConnection.html)

The `AceQLException` contains 5 pieces of information :

Expand Down Expand Up @@ -536,8 +543,8 @@ The atomic variables values will be shared by AceQL download/upload processes an

The values are to be initialized and passed to `AceQLConnection` before the JDBC actions with the static setters:

- [AceQLConnection.setProgress(AtomicInteger progress)](https://docs.aceql.com/rest/soft_java_client/9.2/javadoc/com/aceql/jdbc/commons/AceQLConnection.html#setProgress(java.util.concurrent.atomic.AtomicInteger))
- [AceQLConnection.setCancelled(AtomicBoolean cancelled)](https://docs.aceql.com/rest/soft_java_client/9.2/javadoc/com/aceql/jdbc/commons/AceQLConnection.html#setCancelled(java.util.concurrent.atomic.AtomicBoolean))
- [AceQLConnection.setProgress(AtomicInteger progress)](https://docs.aceql.com/rest/soft_java_client/9.3/javadoc/com/aceql/jdbc/commons/AceQLConnection.html#setProgress(java.util.concurrent.atomic.AtomicInteger))
- [AceQLConnection.setCancelled(AtomicBoolean cancelled)](https://docs.aceql.com/rest/soft_java_client/9.3/javadoc/com/aceql/jdbc/commons/AceQLConnection.html#setCancelled(java.util.concurrent.atomic.AtomicBoolean))


Values will then be updated and read:
Expand Down Expand Up @@ -660,7 +667,7 @@ Assuming hat you want to display a progress indicator using `SwingWorker`, you w
}
```

A complete example is available in [SqlProgressMonitorDemo.java](https://docs.aceql.com/rest/soft_java_client/9.2/src/SqlProgressMonitorDemo.java) and [BlobExample.java](https://docs.aceql.com/rest/soft_java_client/9.2/src/BlobExample.java)
A complete example is available in [SqlProgressMonitorDemo.java](https://docs.aceql.com/rest/soft_java_client/9.3/src/SqlProgressMonitorDemo.java) and [BlobExample.java](https://docs.aceql.com/rest/soft_java_client/9.3/src/BlobExample.java)

## HTTP session options

Expand Down Expand Up @@ -692,18 +699,18 @@ First step is to get an instance of `RemoteDatabaseMetaData`:

### Downloading database schema into a file

Downloading a schema into a Java `File` is done through the method. See the `RemoteDatabaseMetaData` [javadoc](https://docs.aceql.com/rest/soft_java_client/9.2/javadoc/com/aceql/jdbc/commons/metadata/RemoteDatabaseMetaData.html).
Downloading a schema into a Java `File` is done through the method. See the `RemoteDatabaseMetaData` [javadoc](https://docs.aceql.com/rest/soft_java_client/9.3/javadoc/com/aceql/jdbc/commons/metadata/RemoteDatabaseMetaData.html).

```java
File file = new File("db_schema.out.html");
remoteDatabaseMetaData.dbSchemaDownload(file);
```

See an example of the built HTML schema: [db_schema.out.html](https://docs.aceql.com/rest/soft_java_client/9.2/src/db_schema.out.html)
See an example of the built HTML schema: [db_schema.out.html](https://docs.aceql.com/rest/soft_java_client/9.3/src/db_schema.out.html)

### Accessing remote database main properties

The [JdbcDatabaseMetaData](https://docs.aceql.com/rest/soft_java_client/9.2/javadoc/com/aceql/jdbc/commons/metadata/JdbcDatabaseMetaData.html) class wraps instance the main value retrieved by a remote JDBC call to `Connection.getMetaData`():
The [JdbcDatabaseMetaData](https://docs.aceql.com/rest/soft_java_client/9.3/javadoc/com/aceql/jdbc/commons/metadata/JdbcDatabaseMetaData.html) class wraps instance the main value retrieved by a remote JDBC call to `Connection.getMetaData`():

```java
JdbcDatabaseMetaData jdbcDatabaseMetaData = remoteDatabaseMetaData.getJdbcDatabaseMetaData();
Expand All @@ -714,7 +721,7 @@ The [JdbcDatabaseMetaData](https://docs.aceql.com/rest/soft_java_client/9.2/java

### Getting Details of Tables and Columns

See the [javadoc](https://docs.aceql.com/rest/soft_java_client/9.2/javadoc/com/aceql/jdbc/commons/metadata/package-summary.html) of the `com.aceql.jdbc.commons.metadata` package:
See the [javadoc](https://docs.aceql.com/rest/soft_java_client/9.3/javadoc/com/aceql/jdbc/commons/metadata/package-summary.html) of the `com.aceql.jdbc.commons.metadata` package:

```java
System.out.println("Get the table names:");
Expand All @@ -738,7 +745,7 @@ See the [javadoc](https://docs.aceql.com/rest/soft_java_client/9.2/javadoc/com/a

### Code Sample

Standard JDBC [DatabaseMetadata](https://docs.aceql.com/rest/soft_java_client/9.2/javadoc/com/aceql/jdbc/commons/metadata/JdbcDatabaseMetaData.html) and [ResultSetMetadata](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSetMetaData.html) calls are fully supported.
Standard JDBC [DatabaseMetadata](https://docs.aceql.com/rest/soft_java_client/9.3/javadoc/com/aceql/jdbc/commons/metadata/JdbcDatabaseMetaData.html) and [ResultSetMetadata](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSetMetaData.html) calls are fully supported.

`DatabaseMetaData` example:

Expand Down
10 changes: 10 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ The AceQL Client JDBC Driver is licensed under the Apache 2.0
License.


AceQL Client JDBC Driver - Version 9.3 - 24-Feb-2023
----------------------------------------------------

What's new:
- It is now possible to get info about limits set on the server side:
maximum rows available for a SELECT and maximum allowed length
for a BLOB upload.
See com.aceql.jdbc.commons.LimitsInfo Javadoc.


AceQL Client JDBC Driver - Version 9.2 - 25-Nov-2022
----------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.aceql</groupId>
<artifactId>aceql-http-client-jdbc-driver</artifactId>
<version>9.2</version>
<version>9.3</version>

<build>
<plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/aceql/jdbc/commons/AceQLBlob.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/aceql/jdbc/commons/AceQLClob.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
19 changes: 18 additions & 1 deletion src/main/java/com/aceql/jdbc/commons/AceQLConnection.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -659,6 +659,23 @@ public DatabaseInfo getDatabaseInfo() throws SQLException {
return databaseInfo;
}

/**
* Gives info of limits defined on server side.
*
* @return Gives info of limits defined on server side.o.
* @throws SQLException if any Exception occurs
*/
public LimitsInfo getLimitsInfo() throws SQLException {

if (!AceQLConnectionUtil.isGetDatabaseInfoSupported(this)) {
throw new SQLException("AceQL Server version must be >= " + AceQLConnectionUtil.GET_LIMITS_INFO_MIN_SERVER_VERSION
+ " in order to call getLimitsInfo().");
}

LimitsInfo limitsInfo = InternalWrapper.limitsInfoBuilder(aceQLHttpApi);
return limitsInfo;
}

/**
* Returns the cancelled value set by the progress indicator
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/aceql/jdbc/commons/AceQLException.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/aceql/jdbc/commons/ConnectionInfo.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/aceql/jdbc/commons/DatabaseInfo.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/aceql/jdbc/commons/HealthCheck.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/com/aceql/jdbc/commons/InternalWrapper.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -29,6 +29,7 @@

import com.aceql.jdbc.commons.main.http.AceQLHttpApi;
import com.aceql.jdbc.commons.main.metadata.dto.DatabaseInfoDto;
import com.aceql.jdbc.commons.main.metadata.dto.LimitsInfoDto;
import com.aceql.jdbc.commons.metadata.ResultSetMetaDataPolicy;

/**
Expand Down Expand Up @@ -96,5 +97,11 @@ public static DatabaseInfo databaseInfoBuilder(AceQLHttpApi aceQLHttpApi) throws
DatabaseInfo databaseInfo = new DatabaseInfo(databaseInfoDto);
return databaseInfo;
}

public static LimitsInfo limitsInfoBuilder(AceQLHttpApi aceQLHttpApi) throws AceQLException {
LimitsInfoDto limitsInfoDto = aceQLHttpApi.getLimitsInfoDto();
LimitsInfo limitsInfo = new LimitsInfo(limitsInfoDto);
return limitsInfo;
}

}
75 changes: 75 additions & 0 deletions src/main/java/com/aceql/jdbc/commons/LimitsInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aceql.jdbc.commons;

import java.util.Objects;

import com.aceql.jdbc.commons.main.metadata.dto.LimitsInfoDto;

/**
* A simple shortcut class that contains main remote database limits info:
* <ul>
* <li>maxRows: the maximum number of SQL rows that may be returned to the
* client by the AceQL server.</li>
* <li>maxBlobLength: the maximum length allowed for a Blob upload.</li>
* </ul>
* @author Nicolas de Pomereu
*
*/
public class LimitsInfo {

private long maxRows = 0;
private long maxBlobLength = 0;

/**
* Constructor.
* @param limitsInfoDto the Limits DTO
*/
public LimitsInfo(LimitsInfoDto limitsInfoDto) {
Objects.requireNonNull(limitsInfoDto, "limitsInfoDto cannot be null!");
maxRows = limitsInfoDto.getMaxRows();
maxBlobLength = limitsInfoDto.getMaxBlobLength();
}

/**
* Gets the maximum number of SQL rows that may be returned to the client by the
* AceQL server.
*
* @return the maximum number of SQL rows that may be returned to the client by
* the AceQL server.
*/
public long getMaxRows() {
return maxRows;
}

/**
* Gets the maximum length allowed for a Blob upload.
* @return the maximum length allowed for a Blob upload.
*/
public long getMaxBlobLength() {
return maxBlobLength;
}

@Override
public String toString() {
return "LimitsInfo [maxRows=" + maxRows + ", maxBlobLength=" + maxBlobLength + "]";
}


}
4 changes: 2 additions & 2 deletions src/main/java/com/aceql/jdbc/commons/ServerMemoryInfo.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -59,7 +59,7 @@ void setCommittedMemory(long committedMemory) {
* initially requests from the operating system for memory management.
* This method returns <tt>-1</tt> if the initial memory size is undefined.
*
* @return the initial size of memory in bytes;
* @return the initial size of memory in bytes.
*/
public long getInitMemory() {
return initMemory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of AceQL JDBC Driver.
* AceQL JDBC Driver: Remote JDBC access over HTTP with AceQL HTTP.
* Copyright (C) 2021, KawanSoft SAS
* Copyright (c) 2023, KawanSoft SAS
* (http://www.kawansoft.com). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading

0 comments on commit fdbd2d4

Please sign in to comment.