Skip to content

Commit 22d49ff

Browse files
committed
init
0 parents  commit 22d49ff

15 files changed

+1854
-0
lines changed

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
HELP.md
2+
target/
3+
!.mvn/wrapper/maven-wrapper.jar
4+
!**/src/main/**/target/
5+
!**/src/test/**/target/
6+
dependency-reduced-pom.xml
7+
8+
### STS ###
9+
.apt_generated
10+
.classpath
11+
.factorypath
12+
.project
13+
.settings
14+
.springBeans
15+
.sts4-cache
16+
17+
### IntelliJ IDEA ###
18+
.idea
19+
*.iws
20+
*.iml
21+
*.ipr
22+
23+
### NetBeans ###
24+
/nbproject/private/
25+
/nbbuild/
26+
/dist/
27+
/nbdist/
28+
/.nb-gradle/
29+
build/
30+
!**/src/main/**/build/
31+
!**/src/test/**/build/
32+
33+
### VS Code ###
34+
.vscode/

READEME.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## mysql to oracle
2+
3+
# 功能
4+
mysql语法转换oracle, 支持部分mysql语法转换,目前可应用于nacos
5+
6+
### 驱动配置
7+
驱动支持可配置的项目,配置驱动类
8+
```
9+
spring.datasource.driver-class-name=com.cenboomh.commons.ojdbc.driver.MysqlToOracleDriver
10+
```
11+
12+
#### `Java`的启动参数配置
13+
如驱动类无法指定,可通过javaagent配置
14+
```
15+
java -javaagent:path/to/ojdbc-mysql2oracle-x.y.x.jar
16+
```

pom.xml

+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.cenboomh.hicor</groupId>
8+
<artifactId>ojdbc-mysql2oracle</artifactId>
9+
<version>1.0.0-SNAPSHOT</version>
10+
11+
<properties>
12+
<spring-boot.version>2.2.13.RELEASE</spring-boot.version>
13+
</properties>
14+
15+
<dependencyManagement>
16+
<dependencies>
17+
<dependency>
18+
<groupId>com.oracle.database.jdbc</groupId>
19+
<artifactId>ojdbc-bom</artifactId>
20+
<version>21.1.0.0</version>
21+
<type>pom</type>
22+
<scope>import</scope>
23+
</dependency>
24+
25+
<dependency>
26+
<groupId>org.springframework.boot</groupId>
27+
<artifactId>spring-boot-dependencies</artifactId>
28+
<version>${spring-boot.version}</version>
29+
<type>pom</type>
30+
<scope>import</scope>
31+
</dependency>
32+
</dependencies>
33+
</dependencyManagement>
34+
35+
<dependencies>
36+
37+
<dependency>
38+
<groupId>org.javassist</groupId>
39+
<artifactId>javassist</artifactId>
40+
<version>3.23.1-GA</version>
41+
<optional>true</optional>
42+
</dependency>
43+
44+
<dependency>
45+
<groupId>com.oracle.database.jdbc</groupId>
46+
<artifactId>ojdbc8</artifactId>
47+
</dependency>
48+
49+
<dependency>
50+
<groupId>com.github.jsqlparser</groupId>
51+
<artifactId>jsqlparser</artifactId>
52+
<version>4.0</version>
53+
</dependency>
54+
55+
<dependency>
56+
<groupId>org.projectlombok</groupId>
57+
<artifactId>lombok</artifactId>
58+
<optional>true</optional>
59+
</dependency>
60+
61+
<dependency>
62+
<groupId>org.springframework.boot</groupId>
63+
<artifactId>spring-boot-starter-jdbc</artifactId>
64+
<scope>test</scope>
65+
</dependency>
66+
67+
<dependency>
68+
<groupId>org.springframework.boot</groupId>
69+
<artifactId>spring-boot-starter-web</artifactId>
70+
<scope>test</scope>
71+
</dependency>
72+
73+
<dependency>
74+
<groupId>org.springframework.boot</groupId>
75+
<artifactId>spring-boot-starter-test</artifactId>
76+
<scope>test</scope>
77+
<exclusions>
78+
<exclusion>
79+
<groupId>org.junit.vintage</groupId>
80+
<artifactId>junit-vintage-engine</artifactId>
81+
</exclusion>
82+
</exclusions>
83+
</dependency>
84+
85+
</dependencies>
86+
87+
<build>
88+
<plugins>
89+
<plugin>
90+
<artifactId>maven-jar-plugin</artifactId>
91+
<version>3.1.0</version>
92+
<configuration>
93+
<archive>
94+
<manifestEntries>
95+
<!--
96+
Instrumentation Specification
97+
- https://docs.oracle.com/javase/8/docs/technotes/guides/instrumentation/index.html (this doc for java 8)
98+
- https://docs.oracle.com/javase/10/docs/api/java/lang/instrument/package-summary.html#package.description
99+
JAR Manifest - JAR File Specification
100+
- https://docs.oracle.com/javase/10/docs/specs/jar/jar.html#jar-manifest
101+
-->
102+
<Premain-Class>com.cenboomh.commons.ojdbc.agent.JdbcDriverAgent</Premain-Class>
103+
<Boot-Class-Path>${project.artifactId}-${project.version}.jar</Boot-Class-Path>
104+
<Can-Redefine-Classes>false</Can-Redefine-Classes>
105+
<Can-Retransform-Classes>true</Can-Retransform-Classes>
106+
<Can-Set-Native-Method-Prefix>false</Can-Set-Native-Method-Prefix>
107+
</manifestEntries>
108+
</archive>
109+
</configuration>
110+
</plugin>
111+
112+
<plugin>
113+
<groupId>org.apache.maven.plugins</groupId>
114+
<artifactId>maven-compiler-plugin</artifactId>
115+
<configuration>
116+
<source>8</source>
117+
<target>8</target>
118+
</configuration>
119+
</plugin>
120+
121+
<plugin>
122+
<artifactId>maven-shade-plugin</artifactId>
123+
<version>3.2.0</version>
124+
<executions>
125+
<execution>
126+
<id>shade-when-package</id>
127+
<phase>package</phase>
128+
<goals>
129+
<goal>shade</goal>
130+
</goals>
131+
<configuration>
132+
<relocations>
133+
<relocation>
134+
<pattern>javassist</pattern>
135+
<shadedPattern>com.cenboomh.commons.ojdbc.javassist</shadedPattern>
136+
</relocation>
137+
138+
<relocation>
139+
<pattern>net.sf.jsqlparser</pattern>
140+
<shadedPattern>com.cenboomh.commons.ojdbc.net.sf.jsqlparser</shadedPattern>
141+
</relocation>
142+
</relocations>
143+
<artifactSet>
144+
<includes>
145+
<include>org.javassist:javassist</include>
146+
<include>com.github.jsqlparser:jsqlparser</include>
147+
<include>com.oracle.database.jdbc:ojdbc8</include>
148+
</includes>
149+
</artifactSet>
150+
</configuration>
151+
</execution>
152+
</executions>
153+
</plugin>
154+
</plugins>
155+
</build>
156+
157+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.cenboomh.commons.ojdbc;
2+
3+
import lombok.Getter;
4+
import lombok.Setter;
5+
import lombok.experimental.Accessors;
6+
7+
/**
8+
* @author wuwen
9+
*/
10+
@Getter
11+
@Setter
12+
@Accessors(chain = true)
13+
public class Page {
14+
15+
private int startRowIndex;
16+
17+
private Integer startRowValue;
18+
19+
private int endRowIndex;
20+
21+
private Integer endRowValue;
22+
}

0 commit comments

Comments
 (0)