1 | public class ProgressGetTablesTest {↵ | | 1 | public class SybaseNonDboTableTest {↵
|
2 | ↵ | | 2 | ↵
|
3 | private static void test(Connection con) throws Exception {↵ | | 3 | private static void test(Connection con) throws Exception {↵
|
4 | DatabaseMetaData md = con.getMetaData();↵ | | 4 | DatabaseMetaData md = con.getMetaData();↵
|
5 | ↵ | | 5 | ↵
|
6 | String cat = "DBCOPYDEST";↵ | | 6 | String cat = "dbcopydest";↵
|
7 | String schemaPattern = "MANNINGR";↵ | | 7 | String schemaPattern = null;↵
|
8 | String tableNamePattern = "TEST";↵ | | 8 | String tableNamePattern = null;↵
|
|
9 | ResultSet rs = md.getTables(cat,↵ | | 9 | ResultSet rs = md.getTables(cat,↵
|
10 | schemaPattern,↵ | | 10 | schemaPattern,↵
|
11 | tableNamePattern,↵ | | 11 | tableNamePattern,↵
|
12 | new String[] { "TABLE" });↵ | | 12 | new String[] { "TABLE" });↵
|
13 | while (rs.next()) {↵ | | 13 | while (rs.next()) {↵
|
14 | /*↵ | | 14 | /*↵
|
15 | * String catalog, String schema, String simpleName,↵ | | 15 | * String catalog, String schema, String simpleName,↵
|
16 | String tableType, String remarks,↵ | | 16 | String tableType, String remarks,↵
|
17 | */↵ | | 17 | */↵
|
18 | String catalog = rs.getString(1);↵ | | 18 | String catalog = rs.getString(1);↵
|
19 | String schema = rs.getString(2);↵ | | 19 | String schema = rs.getString(2);↵
|
20 | String simpleName = rs.getString(3);↵ | | 20 | String simpleName = rs.getString(3);↵
|
21 | String tableType = rs.getString(4);↵ | | 21 | String tableType = rs.getString(4);↵
|
22 | String remarks = rs.getString(5);↵ | | 22 | String remarks = rs.getString(5);↵
|
23 | System.out.println("catalog: "+catalog);↵ | | 23 | System.out.println("catalog: "+catalog);↵
|
24 | System.out.println("schema: "+schema);↵ | | 24 | System.out.println("schema: "+schema);↵
|
25 | System.out.println("simpleName: "+simpleName);↵ | | 25 | System.out.println("simpleName: "+simpleName);↵
|
26 | System.out.println("tableType: "+tableType);↵ | | 26 | System.out.println("tableType: "+tableType);↵
|
27 | System.out.println("remarks: "+remarks);↵ | | 27 | System.out.println("remarks: "+remarks);↵
|
28 | }↵ | | 28 | }↵
|
29 | } ↵ | | 29 | } ↵
|
30 | ↵ | | 30 | ↵
|
31 | ↵ | | 31 | ↵
|
32 | /**↵ | | 32 | /**↵
|
33 | * @param args↵ | | 33 | * @param args↵
|
34 | */↵ | | 34 | */↵
|
35 | public static void main(String[] args) throws Exception {↵ | | 35 | public static void main(String[] args) throws Exception {↵
|
36 | ApplicationArguments.initialize(new String[] {});↵ | | 36 | ApplicationArguments.initialize(new String[] {});↵
|
37 | Class.forName("com.ddtek.jdbc.openedge.OpenEdgeDriver");↵ | | 37 | Class.forName("com.sybase.jdbc3.jdbc.SybDriver");↵
|
38 | String jdbcUrl = "jdbc:datadirect:openedge://192.168.1.136:20935;DATABASENAME=dbcopydest";↵ | | 38 | String jdbcUrl = "jdbc:sybase:Tds:dbserver:4115/dbcopydest";↵
|
39 | Connection con = DriverManager.getConnection(jdbcUrl,↵ | | 39 | Connection con = DriverManager.getConnection(jdbcUrl,↵
|
40 | "manningr",↵ | | 40 | "dbcopydest",↵
|
41 | "");↵ | | 41 | "password");↵
|
42 | test(con) | | 42 | test(con)
|