Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7518631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:46:36+00:00 2026-05-30T01:46:36+00:00

I have a DB table that uses the following schema: CREATE TABLE users (id

  • 0

I have a DB table that uses the following schema:

CREATE TABLE users
(id SERIAL PRIMARY KEY,
  username TEXT UNIQUE NOT NULL,
  password TEXT NOT NULL,
  email TEXT NOT NULL,
  admin BOOLEAN NOT NULL,
  active BOOLEAN NOT NULL,
  created DATE NOT NULL);

I use Korma by defining a users entity

(defentity users
           (has-many tips))

And I try to seed values using the following functions:

(defn make-user-vals [username pass email]
  "Creates an active, non-admin user"
  {:username username, 
   :password (crypt/encrypt pass), 
   :email email,
   :admin false,
   :active true,
   :created (java.util.Date.)})

(defn seed-users! []
  (insert ent/users
    (values 
      (users/make-user-vals "admin" "f00b4r" "foo@example.com"))))

(seed-users!) fails with the following (not really informative to my eyes) message:

Failure to execute query with SQL:
INSERT INTO users (username, password, email, admin, active, created) VALUES (?, ?, ?, FALSE, TRUE, ?)  ::  [admin $2a$10$AVdxz9HvYOyszhcXVrTVi.oBcbz9EZVfGZYNUI3iDMb0hj3igvpEy foo@example.com #<Date Wed Feb 15 21:59:10 CET 2012>]
ClassCastException java.lang.RuntimeException cannot be cast to java.sql.SQLException  clojure.java.jdbc/print-sql-exception (jdbc.clj:350)

Any idea why?

(if that helps, querying the DB works, so it does not look like a connection problem)

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:46:37+00:00Added an answer on May 30, 2026 at 1:46 am

    You need to use java.sql.Date rather than java.util.Date:

    (java.sql.Date. 2012 2 16)
    

    Incidentally, you might want to investigate clj-time as a time-handling solution. Java’s standard time-and-date-related classes are completely insane (as evidenced by the present issue).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

following on from my other post... I have a table that uses two fields
I have a table called activity that uses the following columns: LoginDate, LoginID, Department,
I have a web page that uses jquery ajax to grab the table markup
I have content management system application that uses a polymorphic tree table as the
I have table that I insert data with following query (from c# code): INSERT
I have a table that got into the db_owner schema, and I need it
I need a table plugin that does the following Uses json and html table
I have the following code that uses Sequence objects to read data from a
I have the following form that uses a GET to pass parameters to a
I have the following code that uses the SqlClient.ExecuteScalar method to return an ID

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.