Skip to content

Commit

Permalink
ARROW-17199: [Java][FlightRPC] Clean up Flight SQL example server (#1…
Browse files Browse the repository at this point in the history
…3710)

- Use ARROW-17004 for binding Arrow data to JDBC PreparedStatements
- Properly return Flight errors for better error messages
- Don't throw SQLException in the FlightSqlClient

Authored-by: David Li <li.davidm96@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
  • Loading branch information
lidavidm authored Aug 4, 2022
1 parent 6d9a6a4 commit 916417d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 544 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.channels.Channels;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
Expand Down Expand Up @@ -442,12 +441,8 @@ public PreparedStatement prepare(final String query, final CallOption... options
}

@Override
public void close() throws SQLException {
try {
AutoCloseables.close(client);
} catch (final Exception e) {
throw new SQLException(e);
}
public void close() throws Exception {
AutoCloseables.close(client);
}

/**
Expand Down Expand Up @@ -557,7 +552,7 @@ private Schema deserializeSchema(final ByteString bytes) {
* @param options RPC-layer hints for this call.
* @return a FlightInfo object representing the stream(s) to fetch.
*/
public FlightInfo execute(final CallOption... options) throws SQLException {
public FlightInfo execute(final CallOption... options) {
checkOpen();

final FlightDescriptor descriptor = FlightDescriptor
Expand Down
Loading

0 comments on commit 916417d

Please sign in to comment.