Created
January 23, 2015 16:22
-
-
Save mwoodiupui/b52d92850f354cafc7c6 to your computer and use it in GitHub Desktop.
Quickie to test DatabaseMetaData.getTables with Oracle (for recycle bin behavior)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.*; | |
class Recycletest | |
{ | |
private static final String URL | |
= "jdbc:oracle:thin:@changeit:1521/XE"; | |
private static final String USER = "changeit"; | |
private static final String PWD = "changeit"; | |
public static void main(String[] argv) | |
throws SQLException | |
{ | |
Connection cnx = DriverManager.getConnection(URL, USER, PWD); | |
DatabaseMetaData meta = cnx.getMetaData(); | |
ResultSet rslt = meta.getTables(null, meta.getUserName(), "XYZZY", | |
null); | |
while (rslt.next()) | |
{ | |
System.out.printf("name: %s\n",rslt.getString("TABLE_NAME")); | |
} | |
cnx.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment