学年

質問の種類

情報 大学生・専門学校生・社会人

Oracle certified Java Programmer Gold SE11 IT系ベンダー資格のOracle certified Java Programmer Gold SE11の資格勉強をしているのですが、もし、Javaに詳しい人がいるのでしたら、 第6章... 続きを読む

8. 次のコードをコンパイル、 実行したときの結果として、正しいものを びなさい。 (1つ選択) } var sql = "select * from item where id = ?": try (var ps = con.prepareStatement (sql)){ ResultSet rs = ps.executeQuery(); // do something 0件の検索結果が戻される 11. 次のコードをコンパイル、実行したときの結果として、正しいものを選 びなさい。(1つ選択) var sql = "select * from emp"; try (PreparedStatement ps = con.prepareStatement(sql){ ResultSet rsps.executeQuery(); System.out.println(rs.getString(2)); なお、 検索する対象となるempテーブルは、以下のレコードが登録さ れているものとする。 DEPARTMENT A. B. 全件の検索結果が戻される C. コンパイルエラーが発生する D. 実行時に例外がスローされる ID NAME 1 ALLEN R&D A. B. executeQueryメソッド C. executeメソッド D. executeBatch メソッド メソッドとして、最も適切なものを選びなさい。 (1つ選択) executeUpdate メソッド 19. JDBCを使ったデータベースプログラミングをしている。 UPDATE文を 実行した結果、 何件更新されたかを調べたい。 PreparedStatementの P314 2 SCOTT SALES 3 BILL ACCOUNTING A. 「1」 と表示される Marit B. 「2」 と表示される C. 「ALLEN」 と表示される D. 「SCOTT」 と表示される E. コンパイルエラーが発生する F. 実行時に例外がスローされる 第6章 JDBCによるデータベース連携 (問題) <->P316 P314 10. 次のコードをコンパイル、 実行したときの結果として、正しいものを選 びなさい。 (1つ選択) var sql = "delete from item where id = ?"; try (var ps = con.prepareStatement(sql))( ps.setInt(1, 1); ps.executeUpdate("update item set name="test' where id = ?'); 12. 次のコードをコンパイル、 実行したときの結果として、正しいものを選 びなさい。 (1つ選択) var sql = "select count(*) from item"; try (PreparedStatement ps = con.prepareStatement(sql)){ System.out.println(ps.execute()); なお、検索する対象となるitemテーブルは、以下のレコードが登録さ れているものとする。 A. DELETE文が実行される id name 1 B. UPDATE文が実行される banana 2 C. コンパイルエラーが発生する apple 3 D. 実行時に例外がスローされる P316 orange 298 ※次ページに続く 299

回答募集中 回答数: 0
情報 大学生・専門学校生・社会人

vsコードを使ってJava言語の勉強をしてたんですけど初心者すぎて何が原因で上手くコードの実行ができてないのかわかりません… 勉強の資料として使ってるのは京都大学のJavaによるプログラミング入門 です。

17:43 7月27日 (木) 1.7 使用するサンプルプログラム (TankCalculator.java) 1: public class Tank Calculator { 2: public static void main (String args[]){ final double FLOW_RATE = 1.0; final double TANK_AREA = 20.0; final double INITIAL_LEVEL = 10.0; double time; //s double tankLevel; //m ... ocw.kyoto-u.ac.jp 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: time = 30; 14: tankLevel = INITIAL_LEVEL + FLOW_RATE*time/TANK_AREA; 15: System.out.println("Tank Level at time "+ time + "s = " + tankLevel + "m"); 16: 17: 18: 19: } 20:} 11 System.out.println("Flow Rate = + FLOW_RATE + "m** 3/s"); System.out.println("Tank Area=" + TANK_AREA + "m**2"); System.out.println("Initial Level = " + INITIAL_LEVEL + "m"); time = 60; tankLevel = INITIAL_LEVEL + FLOW_RATE*time/TANK_AREA; System.out.println("Tank Level at time "+ time + "s=" + tankLevel + "m"); 【補足】 // の後ろは,プログラムを後で読解しやすくするための注釈です. Flow Rate = 1.0m**3/s Tank Area = 20.0mm**2 Initial Level = 10.0m 8 Tank Level time 30.0s = 11.5m Tank Level at time 60.0s = 13.0m 1.7.1 サンプルプログラムの入力と実行 先ほどと同じように, 秀丸エディタを開き, 20行のプログラムを書き込んで, Tank Calculator.java と名付け, 保存して, コンパイル, 実行してください. 成功すれば,以下の実行結果が示されます。(失敗してもめげないで, 2.5.1 節を参 考に、原因を考え,再トライしてください) ちなみに, 実行結果をファイルに書き出すにはコマンドプロンプトの「リダイレク ト」 という機能を使います 11. java TankCalculator > result.txt これにより result.txt というファイルが出来ているはずです。 中身は数値や文字列 だけのテキストファイルですのでエディタなどで内容を確認できます。 @91% 11javaプログラムの中で明示的にフ ァイルに出力することもできるので すがここでは安直な方法を取ります

未解決 回答数: 1
英語 高校生

答えを教えて欲しいです

Past Tense, Past Progressive (2) Warm Up! (1) ( に入れるのに正しくないものを1つ選んでください。(b) Warm Up He began to practice karate only ( ). 1. recently 2. two weeks earlier 3. these days 4. one week ago Part 2: Grammar Section 《解説と解答》 「彼はつい最近 (2週間早く; 先週) 空手の練習を始めた」 という意味ですから、 3. these days のみが、 過去形の動詞と共に使えない表現です。 these days は 「このごろ (最近)」 という意味で すが、 現在形 現在進行形や現在完了形とともに用います。 Warm Up! (2) ( に入れるのに最適な表現を1つ選んでください。 John didn't want to see me because he () his lunch. 1. once had 2. was having 3. has 4. took 《解説と解答》 「ジョンは昼食中だったので、私に会いたがらなかった」 という意味ですから、 ジョンが私に会い たがらなかった理由を完成させます。 私に会いたがらなかった時に進行していた動作が「昼食を取る」 ことですから 2. was having の過去進行形にするのが適切です。 なお、 have lunch の have は 「食 べる (eat) 」 の意味ですから、この意味の場合haveは進行形で用いることができます。 Exercise 5: Fill in the blanks in these sentences with one of the choices below. 3. A pine tree (a) stands 1. While Cindy. (a) was playing (b) is playing (c) played her violin yesterday, two of her strings broke. (d) has played up late the night before to 2. My paper was due yesterday, so I complete it. (a) stayed (b) stood (b) would stay (c) stay (d) am staying at the gate, and a girl was standing in its shade. (d) standing (c) was standing 4. The car wasn't here yesterday because Jane takes the bus, but the drivers were on strike. (a) uses (b) is using (c) has used 5. One of the boys (a) fall (b) falls 6. When the door bell rang, I (a) take (b) am taking 7. Mr. Brown (a) leave (b) is leaving (d) was using in the river, but I dived in and saved him. (c) were falling (d) fell a shower. (c) was taking the office only a minute ago. (c) was leaving 8. During the last earthquake books (a) fall it. She generally (b) are falling (c) had been falling (d) taking (d) left from the shelf. (d) fell Unit 4 Exercise 6: Fill in the blanks in the passage below with the correct form of the verb in parentheses. The first one is done for you. Mark (live) lives in Japan. His family (come) five years ago, when his father (start) Osaka. At that time Mark was still only 10 years old, and he (do) not want to leave America. But now, he (have) Osaka, and he likes living there. During the last summer vacation, Mark (go) United States with his parents. They (visit) Washington D.C., and Boston, and (enjoy) They also (go) Mark's grandparents. His grandparents (be) see Mark. One evening, as they (eat) the telephone (ring) Mark and his parents (talk) over one hour. Now Mark is back in Osaka. He (want) his grandparents again. He is (plan). America by himself next time. to Japan his own business in many friends in back to the New York, seeing the sights. to a small town in Connecticut to (see) very happy to a big chocolate cake, It was Mark's aunt in California. with her one after another for to (visit) to go to

回答募集中 回答数: 0
1/4