eclipse - Postgres Sql Connection in Ofbiz web application -
i developing first web app in ofbiz framework psql database. added postgresql-8.1-404.jdbc2.jar jdbc driver jar /framework/entity/lib/jdbc folder , made necessary corrections entityengine.xml file , trying access table in database following groovy code.
@grabconfig(systemclassloader = true) import groovy.sql.sql class.forname("org.postgresql.driver"); def dburl = "jdbc:postgresql://127.0.0.1:5432/dbname" def dbuser = "postgres" def dbpassword = "root" def dbdriver = "org.postgresql.driver" def sql = sql.newinstance(dburl, dbuser, dbpassword, dbdriver) // groovier... sql.eachrow('select * tablename') { println it.party_id }
but throws following exception
[java] exception: java.sql.sqlexception [java] message: no suitable driver found jdbc:postgresql://127.0.0.1:5432/dbname
help resolve problem...thank you.
Comments
Post a Comment