Skip to content

Commit

Permalink
feat(db-browser): make db-browser adapt to oracle11g (#503)
Browse files Browse the repository at this point in the history
* DBSchemaAccessor adapt to native oralce 11g

* fix OBOracleSchemaAccessorTest

* implement DBStatsAccessor for oracle

* add comment

* response to review

* upgrade db-browser version to 1.1.0
  • Loading branch information
PeachThinking authored Jan 11, 2024
1 parent a93223c commit ead38d6
Show file tree
Hide file tree
Showing 46 changed files with 2,355 additions and 531 deletions.
12 changes: 11 additions & 1 deletion libs/db-browser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.oceanbase</groupId>
<artifactId>db-browser</artifactId>
<version>1.0.5</version>
<version>1.1.0</version>
<name>db-browser</name>
<url>https://github.com/oceanbase/odc/tree/main/libs/db-browser</url>

Expand Down Expand Up @@ -97,6 +97,7 @@
<maven-javadoc-plugin.version>2.9.1</maven-javadoc-plugin.version>
<maven-source-plugin.version>2.2.1</maven-source-plugin.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<oracle.jdbc.version>21.1.0.0</oracle.jdbc.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -195,6 +196,11 @@
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>${oracle.jdbc.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
Expand Down Expand Up @@ -297,6 +303,10 @@
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ public static DBPLParamMode getEnum(String name) {
return IN;
} else if (PLConstants.PL_OUT_PARAM.equalsIgnoreCase(name)) {
return OUT;
} else if (PLConstants.ORACLE_PL_INOUT_PARAM.equalsIgnoreCase(name)
|| PLConstants.MYSQL_PL_INOUT_PARAM.equalsIgnoreCase(name)) {
} else if (PLConstants.OB_ORACLE_PL_INOUT_PARAM.equalsIgnoreCase(name)
|| PLConstants.MYSQL_PL_INOUT_PARAM.equalsIgnoreCase(name)
|| PLConstants.ORACLE_PL_INOUT_PARAM.equalsIgnoreCase(name)) {
return INOUT;
} else {
return UNKNOWN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class DBSession {
/**
* 当前命令执行时间
*/
private int executeTime;
private Integer executeTime;


public static DBSession unknown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
public class PLConstants {
public static final String PL_IN_PARAM = "in";
public static final String PL_OUT_PARAM = "out";
public static final String ORACLE_PL_INOUT_PARAM = "in out";
public static final String OB_ORACLE_PL_INOUT_PARAM = "in out";
public static final String ORACLE_PL_INOUT_PARAM = "IN/OUT";
public static final String MYSQL_PL_INOUT_PARAM = "inout";
public static final String PL_OBJECT_STATUS_INVALID = "INVALID";
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public class DBSchemaAccessorSqlMappers {
StatementsFiles.OBMYSQL_1479,
StatementsFiles.MYSQL_5_7_40,
StatementsFiles.OBORACLE_3_x,
StatementsFiles.OBORACLE_4_0_x));
StatementsFiles.OBORACLE_4_0_x,
StatementsFiles.ORACLE_11_g));
for (String path : SQL_MAPPER_FILE_PATHS) {
URL url = DBSchemaAccessorSqlMappers.class.getClassLoader().getResource(path);
if (url == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ public final class Statements {

public static final String LIST_SCHEMA_INDEX = "list-schema-index";

public static final String LIST_DATABASE = "list-database";

public static final String GET_DATABASE = "get-database";

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ public final class StatementsFiles {

public static final String OBORACLE_3_x = "schema/sql/oboracle/oboracle_3_x.yaml";

public static final String ORACLE_11_g = "schema/sql/oracle/oracle_11g.yaml";

}
Loading

0 comments on commit ead38d6

Please sign in to comment.