Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列型の日付変数を持つ値オブジェクト processVO があります(ゲッターとセッターを使用)。次の方法でDAOクラスに入力しようとしています:- PreparedStatement.setString(processVO.getDate); 次のようなエラーが表示されます:-日付型を文字列に変換できません。// processVO.getDate() に保存されている値には、日付と時刻の両方が含まれています。つまり、「2-apr-2013 1:20 am」です。
これは良い習慣とは見なされませんが、単純に文字列を取得する場合は、次のように processVO.getDate() で toString() メソッドを使用できます。
processVO.getDate().toString()