1

I followed the steps listed in the previous answer to this question here

How can I access a postgresql database from matlab with without matlabs database toolbox?

However, on the step

driver = org.postgresql.Driver;

I'm getting the following error.

Undefined variable "org" or function "org.postgresql.Driver"

I've added it to the dynamic path, and running "javaclasspath" shows the following at the bottom

    DYNAMIC JAVA PATH

M:\postgresql-9.3-1100.jdbc41.jar

any ideas on what is wrong?

2
  • try using javaObject('org.postgresql.Driver'). Does this raise a clear exception? Commented Nov 18, 2013 at 21:24
  • Here's what that outputs Error using javaObject No class org.postgresql.Driver can be located on the Java class path Commented Nov 18, 2013 at 21:40

1 Answer 1

3

You probably got the wrong bytecode-versin of postgresql. The jdbc41 is for java 1.7 and 1.8 only, which is not included at least up to Matlab 13a. Only 13b has Java 1.7 with jdbc41 integrated.

Type ver to check your current JRE integrated into Matlab, then download the correct bytecode-version of postgresql, which is probably jdbc4.

Sign up to request clarification or add additional context in comments.

1 Comment

you're right that solved it. I downloaded java 1.7 separately, but didn't realize matlab came with its own which was 1.6. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.