Re: contrib/sql with postgresql, problem inserting into column of type date

2009-01-08 Thread ssecorp
I don't understand how to use it, can you post an example? I have tried everything and have gotten it to work under circumstances I'm not sure of. However it doesn't work now. (ns progs.netflix.parsing (:require (progs.netflix [pg :as pg])) (:import (java.sql Date))) (load-file "C:/cloj

Re: Simple example of using postgresql with contrib.sql...

2009-01-07 Thread ssecorp
and user.clj function wasn't avilable without importing it when I try to access them if I put a file ina namespace. On Jan 7, 8:27 pm, "Stephen C. Gilardi" wrote: > On Jan 7, 2009, at 12:11 PM, ssecorp wrote: > > > > > This was going to be a question but

Re: Simple example of using postgresql with contrib.sql...

2009-01-07 Thread ssecorp
I tried to use connection in internal to get resultSetMetadata but I never succeeded with it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.

contrib/sql with postgresql, problem inserting into column of type date

2009-01-07 Thread ssecorp
(defn inse [] (sql/with-connection db (sql/transaction (insert-rows :r [[1 2 "date '2008-12-03'" 3]]))) nil) I have tried all kinds of variations. it works perfectly with another table, like (int,int,int,int) and passing [1,2,3,4] so it is the type of column 3 that is the problem. "

Simple example of using postgresql with contrib.sql...

2009-01-07 Thread ssecorp
This was going to be a question but I solved it before I finished the post :) Figured I might post the solution then, hopefully it will help someone else. (import '(java.sql Connection DriverManager ResultSet SQLException Statement ResultSetMetaData)) (import '(org.postgresql

Re: setting foreign and primary key with contrib.sql ? how to setup db with un and pw?

2009-01-06 Thread ssecorp
On Jan 6, 9:20 pm, "Stephen C. Gilardi" wrote: > On Jan 6, 2009, at 2:27 PM, ssecorp wrote: > > > On Jan 6, 8:12 pm, ssecorp wrote: > >> CREATE TABLE foo ( > >>   col1 INTEGER NOT NULL, > >>   col2 VARCHAR(32) NOT NULL, > >

Re: setting foreign and primary key with contrib.sql ? how to setup db with un and pw?

2009-01-06 Thread ssecorp
On Jan 6, 8:12 pm, ssecorp wrote: > CREATE TABLE foo ( >   col1 INTEGER NOT NULL, >   col2 VARCHAR(32) NOT NULL, >   col3 DATE NOT NULL, >   PRIMARY KEY (col1, col2) > ); > > how would I set primary key if it is a combination of 2 keys? also how would I set a ke

Re: setting foreign and primary key with contrib.sql ? how to setup db with un and pw?

2009-01-06 Thread ssecorp
CREATE TABLE foo ( col1 INTEGER NOT NULL, col2 VARCHAR(32) NOT NULL, col3 DATE NOT NULL, PRIMARY KEY (col1, col2) ); how would I set primary key if it is a combination of 2 keys? --~--~-~--~~~---~--~~ You received this message because you are subscribed

setting foreign and primary key with contrib.sql ? how to setup db with un and pw?

2009-01-06 Thread ssecorp
(def db {:classname "org.apache.derby.jdbc.EmbeddedDriver" :subprotocol "derby" :subname "C:/clojure/progs/netflix/netflix.db" :create true}) would I add this to set username and password? ;; :user "ninja" ;; :password "kalle"}) (defn create-reviews-table

Re: Multimethod dispatch on one or more specific arguments

2008-12-14 Thread ssecorp
I had some trouble understanding this at first too. "Here I want to dispatch on the class of the first argument xs. " on the first aargument, ie xs, or on the first argument of xs? This should work: (defmulti group (fn [xs n] (class xs))) (defmulti group (fn [xs n] (class (first xs

string-functions, split/recur-problem

2008-10-06 Thread ssecorp
split is working fine, returns the parts on both sides of the delimiter. but for some reason splitall doesnt, it just does what split does. (also, what si the best way to deal with strings in clojure, java- strings?) (defn split [str delim] (loop [s str acc nil] (cond (= s

Hacking boot.clj, what else needs to be reloaded?

2008-10-06 Thread ssecorp
If I want to add something to boot.clj so I always have it available. lets say h and t for head/first tail/rest (yes i find them annoyingly long). it doesn't work just adding something to the file, do i have to add it somewhere else too? recompile something? --~--~-~--~~---

string-split, help me make it a string again :)

2008-09-10 Thread ssecorp
So this string-splitting function works but it doesn't look very aesthetic and returns a list of lists of \char. I know I can do (map str list) to turn the chars(?) into strings again but how do I append them? And can it be made to look nicer? I don't find it very readable. (defn split [str del