Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: mvn -B package --file pom.xml

- name: Archive artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: OFHSqlDriver
path: |
Expand Down
Binary file modified out/artifacts/OracleBICatalog/OracleCloudSQLQuery.catalog
Binary file not shown.
27 changes: 22 additions & 5 deletions src/main/java/com/oraclefusionhub/jdbc/OFHConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ public class OFHConnection implements java.sql.Connection {
private String fullURL;
private String basicAuth;
private Boolean closed;
private final boolean debugEnabled;

public OFHConnection(String url, Properties properties) throws SQLException {

this.closed = false;
this.debugEnabled = isDebugEnabled(properties);

try {
String user;
Expand Down Expand Up @@ -71,12 +73,12 @@ public Statement createStatement() throws SQLException {
conn.setRequestProperty("Content-Type", "application/soap+xml");
conn.setRequestProperty("SOAPAction", "runReport");
conn.setRequestProperty("Authorization", this.basicAuth);
return new OFHStatement(conn, reportPath);
return new OFHStatement(conn, reportPath, debugEnabled);
}

@Override
public PreparedStatement prepareStatement(String s) throws SQLException {
System.out.println("PrepareStatement: " + s);
debug("PrepareStatement: " + s);
return null;
}

Expand Down Expand Up @@ -1063,7 +1065,7 @@ public void clearWarnings() throws SQLException {

@Override
public Statement createStatement(int i, int i1) throws SQLException {
return null;
return createStatement();
}

@Override
Expand Down Expand Up @@ -1117,7 +1119,7 @@ public void releaseSavepoint(Savepoint savepoint) throws SQLException {

@Override
public Statement createStatement(int i, int i1, int i2) throws SQLException {
return null;
return createStatement();
}

@Override
Expand Down Expand Up @@ -1167,10 +1169,25 @@ public SQLXML createSQLXML() throws SQLException {

@Override
public boolean isValid(int i) throws SQLException {
System.out.println("isvalid: " + i);
debug("isvalid: " + i);
return true;
}

private boolean isDebugEnabled(Properties properties) {
Object debugProperty = properties.get("debug");
if (debugProperty != null) {
return Boolean.parseBoolean(String.valueOf(debugProperty));
}

return Boolean.parseBoolean(System.getProperty("ofh.debug", "false"));
}

private void debug(String message) {
if (debugEnabled) {
System.out.println(message);
}
}

@Override
public void setClientInfo(String s, String s1) throws SQLClientInfoException {

Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/oraclefusionhub/jdbc/OFHDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public OFHDriver() {}

@Override
public Connection connect(String url, Properties properties) throws SQLException {
System.out.println("Props: " + properties);
url = getURL(url);

return new OFHConnection(url, properties);
Expand All @@ -49,8 +48,12 @@ private String getURL(String fullJDBCPath) {
@Override
public DriverPropertyInfo[] getPropertyInfo(String s, Properties properties) throws SQLException {
DriverPropertyInfo reportPathProp = new DriverPropertyInfo("reportPath", "/Custom/OracleCloudSQLQuery/SQLQuery.xdo");
DriverPropertyInfo[] dpi = new DriverPropertyInfo[1];
DriverPropertyInfo debugProp = new DriverPropertyInfo("debug", "false");
debugProp.description = "Enable verbose driver debug logging";
debugProp.choices = new String[] { "true", "false" };
DriverPropertyInfo[] dpi = new DriverPropertyInfo[2];
dpi[0] = reportPathProp;
dpi[1] = debugProp;

return dpi;
}
Expand Down
Loading
Loading