java.jdbc

register dbtype pgsql from com.impossibl.postgres.jdbc.PGDriver

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

If you call (jdbc/with-db-connection [db {:dbtype "pgsql" :host "localhost" :port 5432 :dbname "tabwin_dev" :user "postgres" :password "xxx"}]) it leads to a NPE

[[java.lang.Class forName0 "Class.java" -2]
[java.lang.Class forName "Class.java" 348]
[clojure.lang.RT classForName "RT.java" 2183]
[clojure.lang.RT classForNameNonLoading "RT.java" 2196]
[clojure.lang.RT loadClassForName "RT.java" 2202]
[clojure.java.jdbc$get_connection invokeStatic "jdbc.clj" 290]
[clojure.java.jdbc$get_connection invoke "jdbc.clj" 193]

It would be nice : if pgsql was registered and in case of a misspelled dbtype a more friendlier user message instead of NPE.

Activity

Hide
Sean Corfield added a comment -

Add pgsql and tested against the Impossibl driver. Noted that maxRows does not seem to be obeyed in queries (two test failed) so those are conditionally excluded.

Also improved the error message when an unknown / misspelled dbtype or subprotocol is supplied.

Note: in timing tests the Impossibl driver was much slower on my machine than the regular PostgreSQL driver!

Show
Sean Corfield added a comment - Add pgsql and tested against the Impossibl driver. Noted that maxRows does not seem to be obeyed in queries (two test failed) so those are conditionally excluded. Also improved the error message when an unknown / misspelled dbtype or subprotocol is supplied. Note: in timing tests the Impossibl driver was much slower on my machine than the regular PostgreSQL driver!
Hide
Sean Corfield added a comment -

0.7.0-alpha2 includes this fix.

Show
Sean Corfield added a comment - 0.7.0-alpha2 includes this fix.
Hide
Geraldo Lopes de Souza added a comment -

Thank You Mr. Corfield.

Show
Geraldo Lopes de Souza added a comment - Thank You Mr. Corfield.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: