Skip to content

Instantly share code, notes, and snippets.

@mwoodiupui
Created January 23, 2015 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwoodiupui/b52d92850f354cafc7c6 to your computer and use it in GitHub Desktop.
Save mwoodiupui/b52d92850f354cafc7c6 to your computer and use it in GitHub Desktop.
Quickie to test DatabaseMetaData.getTables with Oracle (for recycle bin behavior)
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