从oracle获取所有触发器名称

时间:2015-05-15 14:35:52

标签: java mysql

为什么我采用空的结果集行?

 ResultSet row = dbmd.getTables("%", "dbuser1", "%", types);
 while (row.next()) {
   System.out.println(result.getString(1));
 }

1 个答案:

答案 0 :(得分:0)

您可以使用此代码:

  try {
   //must be upper case
   String username="dbuser1".toUpperCase();

   ResultSet row = dbmd.getTables("%", username , "%", types);

    while (row.next()) {
      //you need table name for trigger name
      result.getString("TABLE_NAME");
    }
  //catch some errors
  } catch (SQLException e) {
      while (e != null) {
        System.out.println("\n Message: " + e.getMessage());
        System.out.println("\n SQLState: " + e.getSQLState());
        System.out.println("\n ErrorCode: " + e.getErrorCode());
        e = e.getNextException();
      }
   }