public class CDAPExploreDriver implements Driver { public Connection connect(String url, Properties info) throws SQLException { } } <configuration> <property> <name>explore.jdbc.drivers</name> <value>com.example.CDAPExploreDriver</value> </property> </configuration> String url = "jdbc:cdapexplore://localhost:11015/myNamespace"; Properties props = new Properties(); props.setProperty("user", "username"); props.setProperty("password", "password"); Connection conn = DriverManager.getConnection(url, props); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM myTable"); while (rs.next()) { String column1 = rs.getString("column1"); int column2 = rs.getInt("column2"); }


上一篇:
下一篇:
切换中文