Skip to content

Commit

Permalink
fix: remove the directory prefix oceanbase-, configure the datasour…
Browse files Browse the repository at this point in the history
…ce in the sample with real connection info
  • Loading branch information
bruce-pang committed May 10, 2024
1 parent 8df911d commit f32d0f6
Show file tree
Hide file tree
Showing 24 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
with_oceanbase_container: false
- name: 'pymysql'
language: 'python'
- name: 'oceanbase-spring-boot-mysql-jpa'
- name: 'spring-boot-mysql-jpa'
language: 'java'
- name: 'oceanbase-mybatis'
- name: 'mybatis'
language: 'java'
- name: 'oceanbase-spring-jdbc'
- name: 'spring-jdbc'
language: 'java'
uses: ./.github/workflows/basic-ci.yml
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://host:port/dbName?useUnicode=true&amp;characterEncoding=utf-8&amp;useServerPrepStmts=false&amp;useCursorFetch=true"/>
<property name="username" value="*****"/>
<property name="password" value="*****"/>
<property name="url" value="jdbc:mysql://localhost:2881/test?useUnicode=true&amp;characterEncoding=utf-8&amp;useServerPrepStmts=false&amp;useCursorFetch=true"/>
<property name="username" value="username=root@test"/>
<property name="password" value=""/>
</dataSource>
</environment>
</environments>
Expand Down
6 changes: 3 additions & 3 deletions java/oceanbase-mybatis/README.md → java/mybatis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ Since OceanBase supports MySQL mode and Oracle mode, the MySQL driver can be use
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://host:port/dbName?useUnicode=true&amp;characterEncoding=utf-8&amp;useServerPrepStmts=false&amp;useCursorFetch=true"/>
<property name="username" value="*****"/>
<property name="password" value="*****"/>
<property name="url" value="jdbc:mysql://localhost:2881/test?useUnicode=true&amp;characterEncoding=utf-8&amp;useServerPrepStmts=false&amp;useCursorFetch=true"/>
<property name="username" value="username=root@test"/>
<property name="password" value=""/>
</dataSource>
</environment>
</environments>
Expand Down
2 changes: 1 addition & 1 deletion java/oceanbase-mybatis/pom.xml → java/mybatis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.oceanbase.samples</groupId>
<artifactId>oceanbase-mybatis</artifactId>
<artifactId>mybatis</artifactId>
<version>1.0-SNAPSHOT</version>

<name>oceanbase-mysql</name>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://host:port/dbName?useUnicode=true&amp;characterEncoding=utf-8&amp;useServerPrepStmts=false&amp;useCursorFetch=true"/>
<property name="username" value="*****"/>
<property name="password" value="*****"/>
<property name="url" value="jdbc:mysql://localhost:2881/test?useUnicode=true&amp;characterEncoding=utf-8&amp;useServerPrepStmts=false&amp;useCursorFetch=true"/>
<property name="username" value="username=root@test"/>
<property name="password" value=""/>
</dataSource>
</environment>
</environments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.oceanbase.samples</groupId>
<artifactId>oceanbase-spring-boot-mysql-jpa</artifactId>
<artifactId>spring-boot-mysql-jpa</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -75,9 +75,9 @@ spring:
show-sql: true
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://host:port/test?characterEncoding=UTF-8
username: *****
password: *****
url: jdbc:mysql://localhost:2881/test?characterEncoding=UTF-8
username: root@test
password:
#spring.jpa.hibernate.ddl-auto=update
jackson:
serialization:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Since OceanBase supports MySQL mode and Oracle mode, you can use the MySQL drive
<modelVersion>4.0.0</modelVersion>

<groupId>com.oceanbase.samples</groupId>
<artifactId>oceanbase-spring-boot-mysql-jpa</artifactId>
<artifactId>spring-boot-mysql-jpa</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -76,9 +76,9 @@ spring:
show-sql: true
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://host:port/test?characterEncoding=UTF-8
username: *****
password: *****
url: jdbc:mysql://localhost:2881/test?characterEncoding=UTF-8
username: root@sys
password:
#spring.jpa.hibernate.ddl-auto=update
jackson:
serialization:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.oceanbase.samples</groupId>
<artifactId>oceanbase-spring-boot-mysql-jpa</artifactId>
<artifactId>spring-boot-mysql-jpa</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ spring:
show-sql: true
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://host:port/dbname?characterEncoding=UTF-8
username: ***** # your username
password: ***** # your password
url: jdbc:mysql://localhost:2881/test?characterEncoding=UTF-8
username: root@test
password:
#spring.jpa.hibernate.ddl-auto=update
jackson:
serialization:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public class OceanBaseSpringJdbcApplicationTest {

static {
Map<String, String> map = new HashMap<String, String>();
map.put("url", "jdbc:mysql://host:port/dbName");
map.put("url", "jdbc:mysql://localhost:2881/test");
map.put("driverClassName", "com.mysql.cj.jdbc.Driver");
map.put("username", "*****");
map.put("password", "*****");
map.put("username", "root@test");
map.put("password", "");
try {
Class.forName(map.get("driverClassName"));
jdbcTemplate = new JdbcTemplate(DruidDataSourceFactory.createDataSource(map));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public class OceanBaseSpringJdbcApplicationTest {

static {
Map<String, String> map = new HashMap<String, String>();
map.put("url", "jdbc:mysql://host:port/dbName");
map.put("url", "jdbc:mysql://localhost:2881/test");
map.put("driverClassName", "com.mysql.cj.jdbc.Driver");
map.put("username", "*****");
map.put("password", "*****");
map.put("username", "root@test");
map.put("password", "");
try {
Class.forName(map.get("driverClassName"));
jdbcTemplate = new JdbcTemplate(DruidDataSourceFactory.createDataSource(map));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.oceanbase.samples</groupId>
<artifactId>oceanbase-spring-jdbc</artifactId>
<artifactId>spring-jdbc</artifactId>
<version>1.0-SNAPSHOT</version>

<name>oceanbase-spring-jdbc</name>
Expand Down
File renamed without changes.

0 comments on commit f32d0f6

Please sign in to comment.