On Wed, Feb 16, 2011 at 12:36 PM, Hasan Diwan
<di...@economicriskmanagement.com> wrote:
> Rjdbc consistently gives me an execution error with postgresql 9.0s JDBC4
> driver. It's probably something trivial so am including my code below:
>
> library("RJDBC")
> param <- 249
> param2 <- 188129
> postgres <- JDBC("org.postgresql.Driver",
> ".m2/repository/postgresql/postgresql/9.0-801.jdbc4/postgresql-9.0-801.jdbc4.jar")
> con <- dbConnect(postgres, "jdbc:postgresql://hq.d8u.us/erm", user =
> "hdiwan")
> sql <- "select id, startdate, value from dists where profileid = ?"
> data1 <- dbGetQuery(conn, sql, param) # Dies here, no matter what the query,
> tried with "select 1+1" as well as the one above
> data2 <- dbGetQuery(conn, sql, param2)
> cor(data1$V3, data2$V3)
>

The RpgSQL package providesa PostgreSQL driver based on RJDBC,   See
?pgSQL for an example.



-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to