diff --git a/.github/workflows/spring-javaconfig-example.yml b/.github/workflows/spring-javaconfig-example.yml new file mode 100644 index 0000000..f31061d --- /dev/null +++ b/.github/workflows/spring-javaconfig-example.yml @@ -0,0 +1,38 @@ +name: spring-javaconfig-example + +on: + push: + paths: + - "spring-javaconfig-example/**" + branches: [master] + pull_request: + paths: + - "spring-javaconfig-example/**" + types: + - opened + - synchronize + - reopened + +jobs: + build: + name: Build + runs-on: ubuntu-latest + defaults: + run: + working-directory: "spring-javaconfig-example" + strategy: + matrix: + distribution: [ 'temurin' ] + java: [ '17' ] + steps: + - uses: actions/checkout@v3 + + - name: Setup Java ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java }} + distribution: ${{ matrix.distribution }} + cache: 'maven' + + - name: Build with Maven + run: ./mvnw clean verify diff --git a/pom.xml b/pom.xml index c4aeace..16c0281 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,6 @@ - spring-javaconfig-example spring-xml-example jndi-embedded-example jndi-external-example diff --git a/spring-javaconfig-example/README.md b/spring-javaconfig-example/README.md index 2d8298b..ee08162 100644 --- a/spring-javaconfig-example/README.md +++ b/spring-javaconfig-example/README.md @@ -10,9 +10,84 @@ ``` ********************************************************** -Name:MyDS, Time:1, Success:True, Type:Statement, Batch:False, QuerySize:1, BatchSize:0, Query:["CREATE TABLE users (id INT, name VARCHAR(20))"], Params:[] -Name:MyDS, Time:0, Success:True, Type:Prepared, Batch:True, QuerySize:1, BatchSize:2, Query:["INSERT INTO users (id, name) VALUES (?, ?)"], Params:[(1=1,2=foo),(1=2,2=bar)] -Name:MyDS, Time:1, Success:True, Type:Prepared, Batch:True, QuerySize:1, BatchSize:2, Query:["INSERT INTO users (id, name) VALUES (?, ?)"], Params:[(1=3,2=FOO),(1=4,2=BAR)] -Name:MyDS, Time:3, Success:True, Type:Statement, Batch:False, QuerySize:1, BatchSize:0, Query:["SELECT COUNT(*) FROM users"], Params:[] +JDBC: ProxyDataSource#getConnection +JDBC: JDBCConnection#createStatement + +Name:MyDS, Connection:1, Time:0, Success:True +Type:Statement, Batch:False, QuerySize:1, BatchSize:0 +Query:[" + CREATE TABLE users (id INT, name VARCHAR(20))"] +Params:[] +Query took 0msec +JDBC: JDBCStatement#execute +JDBC: JDBCStatement#close +JDBC: JDBCConnection#close +JDBC: ProxyDataSource#getConnection +JDBC: JDBCConnection#prepareStatement +JDBC: JDBCPreparedStatement#getConnection +JDBC: JDBCConnection#getMetaData +JDBC: JDBCPreparedStatement#setObject +JDBC: JDBCPreparedStatement#setString +JDBC: JDBCPreparedStatement#addBatch +JDBC: JDBCPreparedStatement#setObject +JDBC: JDBCPreparedStatement#setString +JDBC: JDBCPreparedStatement#addBatch + +Name:MyDS, Connection:2, Time:0, Success:True +Type:Prepared, Batch:True, QuerySize:1, BatchSize:2 +Query:[" + INSERT + INTO + users + (id, name) + VALUES + (?, ?)"] +Params:[(1,foo),(2,bar)] +Query took 0msec +JDBC: JDBCPreparedStatement#executeBatch +JDBC: JDBCPreparedStatement#close +JDBC: JDBCConnection#close +JDBC: ProxyDataSource#getConnection +JDBC: JDBCConnection#prepareStatement +JDBC: JDBCPreparedStatement#setString +JDBC: JDBCPreparedStatement#setInt +JDBC: JDBCPreparedStatement#addBatch +JDBC: JDBCPreparedStatement#setInt +JDBC: JDBCPreparedStatement#setString +JDBC: JDBCPreparedStatement#addBatch + +Name:MyDS, Connection:3, Time:0, Success:True +Type:Prepared, Batch:True, QuerySize:1, BatchSize:2 +Query:[" + INSERT + INTO + users + (id, name) + VALUES + (?, ?)"] +Params:[(3,FOO),(4,BAR)] +Query took 0msec +JDBC: JDBCPreparedStatement#executeBatch +JDBC: ProxyDataSource#getConnection +JDBC: JDBCConnection#createStatement + +Name:MyDS, Connection:4, Time:2, Success:True +Type:Statement, Batch:False, QuerySize:1, BatchSize:0 +Query:[" + SELECT + COUNT(*) + FROM + users"] +Params:[] +Query took 2msec +JDBC: JDBCStatement#executeQuery +JDBC: JDBCResultSet#next +JDBC: JDBCResultSet#getMetaData +JDBC: JDBCResultSet#getInt +JDBC: JDBCResultSet#wasNull +JDBC: JDBCResultSet#next +JDBC: JDBCResultSet#close +JDBC: JDBCStatement#close +JDBC: JDBCConnection#close ********************************************************** ``` \ No newline at end of file diff --git a/spring-javaconfig-example/pom.xml b/spring-javaconfig-example/pom.xml index 1de00b4..6999a2e 100644 --- a/spring-javaconfig-example/pom.xml +++ b/spring-javaconfig-example/pom.xml @@ -5,6 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 + net.ttddyy dsp-spring-javaconfig-example 1.0-SNAPSHOT @@ -14,14 +15,14 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.RELEASE + 3.1.1 UTF-8 - 1.8 - 1.4.7 + 17 + 1.8.1 @@ -29,17 +30,6 @@ org.springframework.boot spring-boot-maven-plugin - - --add-opens java.base/java.lang=ALL-UNNAMED - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - @@ -51,7 +41,7 @@ - org.hibernate + org.hibernate.orm hibernate-core