3

テーブル/列を編集しようとしていないのに、このエラーが発生します:

com.ibm.db2.jcc.am.SqlSyntaxErrorException: 指定されたテーブルのタイプで操作がサポートされていないため、操作が失敗しました。指定されたテーブル:「DASH103985.wajihs」。テーブル タイプ: "ORGANIZE BY COLUMN"。操作: "RS を使用".. SQLCODE=-1667、SQLSTATE=42858

@MultipartConfig
public class DemoServlet extends HttpServlet {
  private static Logger logger = Logger.getLogger(DemoServlet.class.getName());
  private static final long serialVersionUID = 1L;
  @Resource(lookup="jdbc/db2")DataSource dataSource;

private String getDefaultText() {
  TweetsCombined = new String(" ");
  try {
    // Connect to the Database
    Connection con = null;
    try {
      System.out.println("Connecting to the database");
    } catch (SQLException e) {
      TweetsCombined = "first" +e;
    }

    // Try out some dynamic SQL Statements
    Statement stmt = null;

  try {
    stmt = con.createStatement();
    String tableName = "wajihs";// change table name here to one
                  // chosen in the first website
    String columnName = "msgBody";// msgBody is where the tweets
                                          // are stored
    String query = "SELECT * FROM \"" + tableName + "\"";
    ResultSet rs = stmt.executeQuery(query);

    while (rs.next()) {
      content = rs.getString(columnName) + ". ";
      if (content.toLowerCase().contains("RT".toLowerCase())
              || content.toLowerCase().contains("Repost: ".toLowerCase())) {
        // do nothing
      }
      else {
        TweetsCombined.concat(content);
      }

    }
    // Close everything off
    // Close the Statement
    stmt.close();
    // close
    con.commit();
    // Close the connection
    con.close();
  } catch (Exception e) {
    TweetsCombined = "second" +e;
    System.out.println(e.getMessage());
  }
} catch (Exception e) {
  TweetsCombined = "third" + e;
  System.out.println(e);
}
return TweetsCombined;

}

4

1 に答える 1

3

ここで説明したように、BLU アクセラレーション機能を備えた dashDB には、BLU アクセラレーションなしの DB2 と比較して特定の制限があります。あなたの場合、カラム編成テーブルに対して CS 分離レベルでのみクエリを実行できるということです。

接続構成を変更して CS 分離レベルを使用するか、明示的に指定してテーブルを作成してくださいORGANIZE BY ROW

于 2015-08-19T00:28:52.890 に答える