Skip to content

Commit

Permalink
net-sf-ucanaccess-fork: Prefer UcanaccessConnection over Connection r…
Browse files Browse the repository at this point in the history
…eturned from builder
  • Loading branch information
spannm committed Nov 24, 2023
1 parent 751383b commit 653c31c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/test/java/net/ucanaccess/jdbc/FolderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.junit.jupiter.params.provider.MethodSource;

import java.io.File;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLWarning;

Expand All @@ -24,7 +23,7 @@ void testFolderContent(AccessVersion _accessVersion) throws SQLException, ClassN

File folder = new File(folderPath);
for (File fl : folder.listFiles()) {
Connection conn = buildConnection()
UcanaccessConnection conn = buildConnection()
.withDbPath(fl.getAbsolutePath())
.build();
SQLWarning sqlw = conn.getWarnings();
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/net/ucanaccess/jdbc/MultiThreadAccessTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.junit.jupiter.params.provider.MethodSource;

import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
Expand Down Expand Up @@ -40,7 +39,7 @@ void crud() throws SQLException {
}

void crudPS() throws SQLException {
try (Connection conn = buildConnection().withDbPath(dbPath).build()) {
try (UcanaccessConnection conn = buildConnection().withDbPath(dbPath).build()) {
conn.setAutoCommit(false);
PreparedStatement ps = conn.prepareStatement("INSERT INTO " + tableName + " (id,descr) VALUES(?, ?)");
ps.setInt(1, ++intVal);
Expand Down
6 changes: 2 additions & 4 deletions src/test/java/net/ucanaccess/jdbc/PasswordTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;

import java.sql.Connection;

class PasswordTest extends UcanaccessBaseTest {

@Override
Expand All @@ -24,11 +22,11 @@ void testPassword(AccessVersion _accessVersion) throws Exception {
.isInstanceOf(UcanaccessSQLException.class)
.hasMessageContaining("Password authentication failed");

try (Connection ucanaccessConnection = new UcanaccessConnectionBuilder()
try (UcanaccessConnection conn = new UcanaccessConnectionBuilder()
.withDbPath(getAccessTempPath())
.withPassword("ucanaccess")
.build()) {
assertNotNull(ucanaccessConnection);
assertNotNull(conn);
}
}
}

0 comments on commit 653c31c

Please sign in to comment.