Access postgres in matlab without database toolbox - matlab

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?

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.

Related

How to resolve Pymongo Runtime Error R6034 in Houdini

I'm working at a visual effects studio in which we use MongoDB/pymongo for our asset management. Our studio is using the SideFX software Houdini.
So far MongoDB has been a pleasure to work with in terms of programming, however whenever we connect to the MongoDB via pymongo from within Houdini, we're getting the following error:
Microsoft Visual C++ Runtime Library - Runtime Error!
Program: C:\houdini\17.5.293\bin\houdini.exe
R6034
An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information.
This error occurs everytime when we import pymongo for the very first time, i.e. in a Python shell within Houdini, which is using Python 2.7. Once we click 'OK' on the error popup (it appears twice after clicking OK for the first time), the error disappears and we're able to connect successfully to the database.
The SideFX support team suggested that pymongo wasn't compiled with Visual Studio 2017, which is the compiler SideFX is using for their software.
Now we've been trying to debug this for a while now to no avail. Here's a rundown of what we tried:
update Windows10 to the latest and greatest
updating pymongo from 3.5.1 to 3.9.0
launching Houdini from different builds (16.5, 17.0, 17.5), we get the error in every version.(We're launching a vanilla Houdini session without any 'PYTHONPATH' or 'PATH' environment variables set)
interestingly enough my colleague imported pymongo into Houdini successfully on his private laptop last night without any errors occurring which leads me to believe that the error might be related to our system settings possibly?
I would love to find out how to get rid of this error message because it is really messing with our current pipeline. Any suggestions/help is welcome and much appreciated.
Please let me know if you need any additional information in order to debug this matter.
Thanks a lot in advance,
Manu
This post here helped me to resolve my issue:
Runtime error R6034 in embedded Python application
What happened is that we have a Python 2.7 install located at C:\Python27 which is being added as an environment variable 'path' in Windows.
Using the Process Explorer, I learned that this folder contains the file 'msvcr90.dll' which is conflicting with Houdini, since Houdini comes with its own Python installation that doesn't contain this dll file.
The solution is simple. When launching Houdini in a custom environment, strip the C:\Python27 from the 'path' environment variable so Houdini only fires up its own Python interpreter.

Connect PostgreSQL to HammerDB

As the title says, I want to connect PostgreSQL (I'm using the 9.6 x86 version) to HammerDB, an open source database load testing and benchmarking tool (I'm interested in the TPC-C Benchmark).
The thing is that I can do this connection by using MS SQL Server (2014), because it is relatively easy. However, I'm not used to use PostgreSQL. When I try to create Virtual Users on HammerDB (that's the 1st step to do, then you should be able to perform the transactions) I get the following error:
Error in Virtual User 1: Failed to load Pgtcl - Postgres Library Error
I did some research about this, and I found that, and I quote "PostgreSQL is VERY particular about the libraries in its PATH - they have to be the right ones and ONLY the right ones any other configuration will cause errors".
The problem is that HammerDB couldn't load library libpgtcl.dll. There they mention that to fix the problem, one should check that the PostgreSQL bin directory has been added to the path during install, but at this point I'm totally lost and I don't know what to do. I simply can´t get what they mean and how to do it.
I hope at least one of you could help me. I would appreciate it a lot.
Sorry in advance for my mistakes in English, I'm a Spanish speaker.
Well, I have solved the problem, and it is very simple.
Everything is about Setting Windows PATH for PostgreSQL, and I found that here.
Open my Computer ==>
right click inside my computer and select properties ==>
Click on Advanced System Settings ==>
Environment Variables ==>
from the System Variables box select "PATH" ==>
Edit... ==>
Then add this at the end of whatever you find their
;C:\PostgreSQL\9.2\bin; C:\PostgreSQL\9.2\lib
after that continue to click OK
That's all. So this is what you should do if you are having trouble when trying to connect PostgreSQL to HammerDB, and in general, when trying to use PostgreSQL tools.

java.lang.NoClassDefFoundError: java/util/concurrent/CompletableFuture while running bin/gremlin.sh

im trying to setup Titan db on MAC OS X. unziped titan-1.0.0-hadoop1.zip...in bin folder tried to execute gremlin.sh and saw the error.
Can someone help?
The class java/util/concurrent/CompletableFuture was introduced in Java 8. So it Looks like you have an older jre running. Change to Java8 and the exception should go away
See the documentation of this class

LabVIEW MongoDB

In LabVIEW applicatio, I want to write some data in a MongoDB.
I found the C# Driver for LabVIEW under the following link: https://decibel.ni.com/content/docs/DOC-41766
When i open the LV-project and try to run an example, i get many errors.
Mainly the class of the driver can´t include / load.
.NET is installed on the system.
Has someone any idea or can give instructions to get the driver running in LabVIEW?
Did you create a LabVIEW.exe.config file (there's an example in the MongoDB-driver package) and store it in the same folder as LabVIEW.exe and relaunch? That did the job for me!
http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/configuring_clr_version/

how function pg_ls_dir () work in postgresql 8.0.6?

Behold, I send such a request to the database
select pg_ls_dir('. . . /data/pg_log/') as files_dir;
and I get an answer here:
ERROR: function pg_ls_dir("unknown") does not exist
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
It says here that there is no function version of postgresql c I work with (8.0.6), is there any way to connect to the desired function, or the other way is even files from the directory?
That's because you're using an old version of Postgres. pg_ls_dir() appeared in version 8.1.
I would strongly suggest you upgrade to the latest version (9.3 as of this writing) if at all possible, as version 8.0 is nine years old and no longer supported.
The pg_ls_dir() function was introduced in PostgreSQL 8.1 so it's not available in 8.0.
You could try adding the function to the installation manually but I would advise against it. Here's the source regardless: http://doxygen.postgresql.org/builtins_8h.html#a35b15cee7a44663710a7125c5b57484d