Home:ALL Converter>Connect to postgresql database via MATLAB error

Connect to postgresql database via MATLAB error

Ask Time:2012-01-14T03:03:10         Author:Jeiman

Json Formatter

I am trying to connect my Postgres database in MATLAB and it is throwing me an error stating

"'JDBC Driver Error: org.postgresql.Driver. Driver Not Found/Loaded.'"

Here's my connection method that i have used.

conn = database('postgres','username','password','org.postgresql.Driver', 'jdbc:postgresql://localhost:5432/postgres=postgres');

after that it throws me the error.

I have looked at forums and they told me to add the postgres jar files to the MATLAB directory toolkit textfile, such as below.

C:\Program Files\PostgreSQL\pgJDBC\postgresql-8.4.702.jdbc3.jar 
C:\Program Files\PostgreSQL\pgJDBC\postgresql-8.4.702.jdbc4.jar 

I don't know where else I am going wrong. Please advise.

Thank you.

Author:Jeiman,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/8855781/connect-to-postgresql-database-via-matlab-error
yy