Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java JDBC: Use explicit schema name testdrive #748

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions by-language/java-jdbc/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
test:
mvn exec:java -Dexec.args="--dburl 'jdbc:postgresql://localhost:5432/'"
mvn exec:java -Dexec.args="--dburl 'jdbc:crate://localhost:5432/'"
mvn exec:java -Dexec.args="--dburl 'jdbc:postgresql://localhost:5432/testdrive'"
mvn exec:java -Dexec.args="--dburl 'jdbc:crate://localhost:5432/testdrive'"
8 changes: 4 additions & 4 deletions by-language/java-jdbc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ Invoke example program::
Connect to instance on ``localhost``::

# Use vanilla PostgreSQL JDBC driver.
mvn exec:java -Dexec.args="--dburl 'jdbc:postgresql://localhost:5432/'"
mvn exec:java -Dexec.args="--dburl 'jdbc:postgresql://localhost:5432/testdrive'"

# Use CrateDB legacy JDBC driver.
mvn exec:java -Dexec.args="--dburl 'jdbc:crate://localhost:5432/'"
mvn exec:java -Dexec.args="--dburl 'jdbc:crate://localhost:5432/testdrive'"

Connect to CrateDB Cloud::

# Use vanilla PostgreSQL JDBC driver.
mvn exec:java -Dexec.args="--dburl 'jdbc:postgresql://example.aks1.westeurope.azure.cratedb.net:5432/' --user 'admin' --password '<PASSWORD>'"
mvn exec:java -Dexec.args="--dburl 'jdbc:postgresql://example.aks1.westeurope.azure.cratedb.net:5432/testdrive' --user 'admin' --password '<PASSWORD>'"

# Use CrateDB legacy JDBC driver.
mvn exec:java -Dexec.args="--dburl 'jdbc:crate://example.aks1.westeurope.azure.cratedb.net:5432/' --user 'admin' --password '<PASSWORD>'"
mvn exec:java -Dexec.args="--dburl 'jdbc:crate://example.aks1.westeurope.azure.cratedb.net:5432/testdrive' --user 'admin' --password '<PASSWORD>'"

In order to clean the build artefacts, invoke::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class JdbcMetaDataTest {
.fromURL("https://cdn.crate.io/downloads/releases/nightly/crate-latest.tar.gz")
.settings(Map.of("psql.port", 55432))
.build();
public static final String URL = "jdbc:postgresql://localhost:55432/doc?user=crate";
public static final String URL = "jdbc:postgresql://localhost:55432/testdrive?user=crate";

@Test
public void test_allProceduresAreCallable() throws Exception {
Expand Down
4 changes: 2 additions & 2 deletions by-language/java-qa/src/test/java/io/crate/qa/JdbcTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public class JdbcTest {
.fromURL("https://cdn.crate.io/downloads/releases/nightly/crate-latest.tar.gz")
.settings(Map.of("psql.port", 55433))
.build();
public static final String URL = "jdbc:postgresql://localhost:55433/doc?user=crate";
public static final String URL = "jdbc:postgresql://localhost:55433/testdrive?user=crate";

@After
public void after() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var tables = conn.getMetaData().getTables(null, "doc", null, null);
var tables = conn.getMetaData().getTables(null, "testdrive", null, null);
while (tables.next()) {
String schema = tables.getString(2);
String table = tables.getString(3);
Expand Down