Skip to content

Commit 8a31780

Browse files
authored
Merge pull request #18720 from eugenp/move-jdbc-articles
Move jdbc articles
2 parents 30b4830 + 4863606 commit 8a31780

File tree

17 files changed

+133
-98
lines changed

17 files changed

+133
-98
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
<artifactId>jdbc-mysql</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
9+
<parent>
10+
<groupId>com.baeldung</groupId>
11+
<artifactId>persistence-modules</artifactId>
12+
<version>1.0.0-SNAPSHOT</version>
13+
</parent>
14+
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>com.mysql</groupId>
19+
<artifactId>mysql-connector-j</artifactId>
20+
<version>${mysql-connector-java.version}</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>org.junit.jupiter</groupId>
24+
<artifactId>junit-jupiter</artifactId>
25+
<version>${junit-jupiter.version}</version>
26+
<scope>test</scope>
27+
</dependency>
28+
<dependency>
29+
<groupId>com.github.mwiede</groupId>
30+
<artifactId>jsch</artifactId>
31+
<version>${jsch.version}</version>
32+
</dependency>
33+
34+
</dependencies>
35+
36+
<build>
37+
<plugins>
38+
<plugin>
39+
<artifactId>maven-surefire-plugin</artifactId>
40+
<version>3.5.0</version>
41+
</plugin>
42+
</plugins>
43+
</build>
44+
45+
<properties>
46+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
47+
<maven.compiler.source>1.8</maven.compiler.source>
48+
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
49+
50+
<jsch.version>0.2.20</jsch.version>
51+
<mysql-connector-java.version>8.0.32</mysql-connector-java.version>
52+
</properties>
53+
54+
</project>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
public class MySQLLoadDriverUnitTest {
2-
3-
@Test
4-
void givenADriverClass_whenDriverLoaded_thenEnsureNoExceptionThrown() {
5-
assertDoesNotThrow(() -> {
6-
Class.forName("com.mysql.cj.jdbc.Driver");
7-
});
8-
}
9-
10-
}
1+
package com.baeldung.classnotfound;
2+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
3+
4+
import org.junit.jupiter.api.Test;
5+
6+
public class MySQLLoadDriverUnitTest {
7+
8+
@Test
9+
void givenADriverClass_whenDriverLoaded_thenEnsureNoExceptionThrown() {
10+
assertDoesNotThrow(() -> {
11+
Class.forName("com.mysql.cj.jdbc.Driver");
12+
});
13+
}
14+
15+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.baeldung;
1+
package com.baeldung.truncation;
22

33
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
44
import static org.junit.jupiter.api.Assertions.assertThrows;

persistence-modules/jdbc/pom.xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.baeldung.core-java-persistence-4</groupId>
6+
<artifactId>jdbc</artifactId>
7+
<version>0.1.0-SNAPSHOT</version>
8+
<packaging>jar</packaging>
9+
<name>jdbc</name>
10+
11+
<parent>
12+
<groupId>com.baeldung</groupId>
13+
<artifactId>persistence-modules</artifactId>
14+
<version>1.0.0-SNAPSHOT</version>
15+
</parent>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>com.h2database</groupId>
20+
<artifactId>h2</artifactId>
21+
<version>${h2.version}</version>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>org.mockito</groupId>
26+
<artifactId>mockito-junit-jupiter</artifactId>
27+
<version>5.16.0</version>
28+
<scope>test</scope>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.springframework</groupId>
32+
<artifactId>spring-web</artifactId>
33+
<version>${springframework.spring-web.version}</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter</artifactId>
38+
<version>${springframework.boot.spring-boot-starter.version}</version>
39+
</dependency>
40+
</dependencies>
41+
42+
<build>
43+
<plugins>
44+
<plugin>
45+
<groupId>org.apache.maven.plugins</groupId>
46+
<artifactId>maven-compiler-plugin</artifactId>
47+
<configuration>
48+
<source>17</source>
49+
<target>17</target>
50+
</configuration>
51+
</plugin>
52+
</plugins>
53+
</build>
54+
55+
<properties>
56+
<h2.version>2.3.230</h2.version>
57+
<springframework.boot.spring-boot-starter.version>3.0.4</springframework.boot.spring-boot-starter.version>
58+
<springframework.spring-web.version>6.0.6</springframework.spring-web.version>
59+
</properties>
60+
</project>

persistence-modules/jdbc/solving-class-not-found-exception-mysql-jdbc/junit5-jupiter-starter-maven/pom.xml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)