; ----------------------------------------------------------------- ; ; derby_update.clj ; ; Jul/17/2014 ; ; ----------------------------------------------------------------- (import '(java.util Date)) (import '(java.text SimpleDateFormat)) (use 'clojure.java.jdbc) ; (println "*** 開始 ***") (let [db-host "localhost" db-name "city_aaa;create=true" id (first *command-line-args*) population (second *command-line-args*) today (. (new SimpleDateFormat "yyyy-MM-dd") format (new Date)) ] (println id) (println population) (println today) (def db {:classname "org.apache.derby.jdbc.ClientDriver" :subprotocol "derby" :subname (str "//" db-host "/" db-name) }) ; :user "APP" ; :password "user1"}) (with-connection db (update-values :cities ["id=?" id] {:population population :date_mod today}) )) (println "*** 終了 ***") ; -----------------------------------------------------------------