feat(oscar): add OSCAR database support

This commit is contained in:
t8y2 committed 2026-06-30 20:07:55 +08:00
1 parent d3272b4750
commit 25dcbeb7e4
33 files changed
+204 -19

No files matched your search

@@ -0,0 +1,21 @@
package com.dbx.agent.oscar;
import com.dbx.agent.ConfiguredJdbcAgent;
import com.dbx.agent.JdbcAgentProfile;
import com.dbx.agent.JsonRpcServer;
public final class OscarAgent extends ConfiguredJdbcAgent {
public static final JdbcAgentProfile OSCAR_PROFILE = new JdbcAgentProfile(
"com.oscar.Driver",
"jdbc:oscar://{host}:{port}/{database}",
2003
);
public OscarAgent() {
super(OSCAR_PROFILE);
}
public static void main(String[] args) {
new JsonRpcServer(new OscarAgent()).run();
}
}
@@ -0,0 +1,16 @@
package com.dbx.agent.oscar;
import com.dbx.agent.JdbcAgentProfile;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
class OscarAgentTest {
@Test
void declaresOscarJdbcProfile() {
JdbcAgentProfile profile = OscarAgent.OSCAR_PROFILE;
Assertions.assertEquals("com.oscar.Driver", profile.getDriverClass());
Assertions.assertEquals("jdbc:oscar://{host}:{port}/{database}", profile.getUrlTemplate());
Assertions.assertEquals(2003, profile.getDefaultPort());
}
}