Forums: Open Discussion (Thread #21190)

DBからのデータ取得問題について (2009-01-07 19:13 by Anonymous #41014)

下記のソースでDBのデータを取得したいですが、取得できませんでした。
List bean = _dao.executeForObjectList("TestDo", null);
エラーもないですけど、beanの内容としては、全部NULLです。だが、beanの項目数はDBの記録数と同じです。

DB環境はpostqreSQLです。

原因について何か心当たりがございましたらご教示いただけますと幸いです。

Reply to #41014×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: DBからのデータ取得問題について (2009-01-07 19:42 by kimumasa #41015)

http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/ja/iBATIS-SqlMaps-2_ja.pdf
のP71、「ステップ2:Log4J」の設定をすると
実行されているSQLやバインド値を見ることが出来ます。

そのログを使ってPostgreSQLに対し
直接SQLを実行すると
何が原因なのか分かるかもしれません。

(Beanのフィールド名とカラム名が
 合致していないのでは?とは思いますが。。。)

蛇足ですが
実行しているSQL、Bean、DDLをサンプル提示して頂ければ
もう少し的確に返事がつくのではと思います。
Reply to #41014

Reply to #41015×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: DBからのデータ取得問題について (2009-01-14 22:26 by Anonymous #41213)

ご回答ありがとうございます。

質問した時は、DBから抽出している項目を格納するBeanを作成していませんでした。

解決できました。
Reply to #41014

Reply to #41213×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login