MATLAB to postgreSQL

조회 수: 12 (최근 30일)
Dmitry
Dmitry 2012년 1월 10일
I try to connect matlab and postgresql,
conn = database('database', 'postgres', '12345', 'org.postgresql.Driver', 'jdbc:postgresql://localhost:5432/');
but
Error using database>errorhandling (line
209)
[Microsoft][ODBC Driver Manager] Data
source name not found and no default driver
specified Please verify that login
information and database url are valid.
Error in database (line 184)
errorhandling(connection.Message);
Error in convertDBtoMat (line 26)
conn = database('database', 'postgres', '12345');
What i need to do
thank you

답변 (1개)

the cyclist
the cyclist 2012년 1월 10일
Two thoughts:
  1. Have you added the driver to your path? You need a statement like javaaddpath('/path_to_directory/postgresql-8.3-604.jdbc3.jar')
  2. Is your database source name really called "database"?
  댓글 수: 3
the cyclist
the cyclist 2012년 1월 10일
Hm. I don't think I have any other specific hypotheses of what it could be. Some general things you could try, though:
Use the debugger to halt the execution inside database.m, stepping through to see where exactly the database object "connection" might seem to be going wrong. It will make a call to the java method "makeDatabaseConnection" (probably on line 130), so that's a good place to check if things are in order.
Are you able to connect to the database from your machine using another program? For example, can you use the same setup to access your database using pgAdmin?
You might want to contact Mathworks support. Database Toolbox questions often don't get a lot of traffic here, so I suspect there are not a lot of people knowledgeable about it.
Dmitry
Dmitry 2012년 1월 10일
Thank you. I will try to do something.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by