I have created a C# console project using Visual Studio 2008 and OracleClient (OCI) libraries to connect to a Oracle 11g database. This code works in Windows. I copied the whole project into Linux and Open the solution using MonoDevelop 4.2.3. But while running the project, the Database Open call throws an exception
string connectionString = "Data Source=Test; User ID=UID; Password=PWD"
OracleConnection conn = new OracleConnection()
conn.ConnectionString = connectionString;
conn.Open();
Exception:
System.DllNotFoundException: libclntsh.so at (wrapper
managed-to-native)
System.Data.OracleClient.Oci.OciCalls/OciNativeCalls:OCIEnvCreate
The libclntsh.so file is under the location /home/dbuser/instantclient_12_1
I have set the environment variable by adding the below in the /home/dbuser/.bashrc file and rebooted the system.
export
LD_LIBRARY_PATH=/home/dbuser/instantclient_12_1:$LD_LIBRARY_PATH
But still I am getting the same error. I couldn't find any option to include the Libraries in the MonoDevelop.
Thanks
Looks like LD_LIBRARY_PATH environment variable is not set up correctly or does not get applied.
Try creating additional linker configuration file instead with the following command:
echo /home/dbuser/instantclient_12_1 > /etc/ld.so.conf.d/instantclient.conf
Then as root update linker cache with command:
ldconfig
Restart MonoDevelop and try again.
I have resolved the issue by doing the following
echo $ORACLE_HOME/lib > /etc/ld.so.conf.d/dbconf.conf
set the$ORACLE_HOME, $ORACLE_INCLUDE_PATH and $ORACLE_LIB_PATH to
/etc/profile.d
Because of some reason MonoDevelop IDE is not picking the library libclntsh.so if I use the OCI client libraries
Related
How can I add a new Environment Variable to the Qt installer. I know that it should go in the .qs script something like the following:
var path = installer.environmentVariable("PATH") + ";" + installer.value("TargetDir");
component.addElevatedOperation("EnvironmentVariable","PATH",path,true);
I'm trying the above on Linux, but it's complaining about EnvironmentVariable not existing when I install my program.
Well this operation is only supported on windows, but you can try do this:
component.addElevatedOperation("AppendFile", "/etc/environment", "export PATH=\"$PATH;#TargetDir#\"\n");
Warning: do this only on installation process
if (installer.isInstaller()) {
[...]
}
If this runs on unistallation, maybe can delete other things of /etc/environment
I am using libzdb - Database Connection Pool Library with sqlite database. I am getting following exception :
Failed to start connection pool - database protocol 'sqlite' not supported
After ConnectionPool_start() - it goes in static int _fillPool(T p), in that it is getting falied at above statement
Connection_T con = Connection_new(P, &P->error);
My connection url is as follows :
sqlite:///home/ZDB_TESTING/zdb-test/testDb.db
Kindly help me with this problem.
This means that the SQLite library is not compiled into the libzdb library. If installing from a distribution, make sure that you select libzdb built with SQLite. If you built libzdb yourself from source, after you run ./configure make sure the output says, SQLite3: ENABLED. Otherwise you need to install SQLite on your system first.
I'm working on a project to write invoices to an excel workbook in PeopleSoft 9.2 using PeopleTools 8.54. In our old version (8.49) we did this:
&oWorkApp_Inv = CreateObject("COM", "Excel.Application");
&oWorkApp_Inv.DisplayAlerts = "False";
&oWorkBook_Inv = ObjectGetProperty(&oWorkApp_Inv, "Workbooks");
Doing the same in 8.54, I get an error that the application class COM is not found. I've researched through PeopleBooks and it suggested doing exactly what I'm doing, even with COM as the class. What can I do to fix this, and in what package can I find COM?
The two requirements for using the COM object are:
The server is running Windows
Excel is installed on the server
I created an App Engine is 8.54.13 and it ran successfully on my PSNT process scheduler.
Local object &excel;
&excel = CreateObject("COM", "Excel.Application");
&excel.quit();
I am working on deploying a shiny application in a Docker container onto Bluemix. I am using the rocker/shiny Docker image (https://hub.docker.com/r/rocker/shiny/) as my initial starting point. I have installed unixODBC-dev, RODBC, ibm data server driver package, the ibmdbR library for R, and all needed dependencies. My only problem is that when I try to access the shiny app from a web browser it fails to execute, the error is:
Warning in odbcDriverConnect("DSN=BLUDB", :
[RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib '/root/db2_cli_odbc_driver/dsdriver/odbc_cli_driver/linuxamd64/clidriver/lib/libdb2o.so' : file not found
Warning in odbcDriverConnect("DSN=BLUDB; :
ODBC connection failed
Error in idaInit(con) : con is not an open connection, please use idaConnect() to create an open connection to the data base.
Initially I had this same problem whenever I would try to use isql to connect to the database or try to connect from RStudio, I used ldd on that library file and found what was missing and that fixed making connections from the command line and RStudio, however my Shiny-Server still gives me the same error, is there anything I am missing?
I ended up solving the problem myself, turns out the libraries were not accessible by the shiny-server which was running as a service. I moved the db2 odbc drivers over to /usr/local/lib to make it accessible, I also ran the "ldd" command on the library mentioned in the error message and found that I had to install libxml2 as well. After doing that I simply changed my odbcinst.ini file at /etc to reference the new location of the db2 library and now it all works! Hopefully anyone else trying to deploy Shiny Apps that rely on connecting to a DB2 database will find this useful.
Well I'm new to to stackoverflow so I'm sorry if I misinterpreted some of this Q&A rules feel free to point out any mistake, and for my English, since I'm not an English native speaker.
Now, although I program for several years, I've been forced to use an old version of JDeveloper on this project I'm in, and I've had some beginner issues, because I'm used to let the IDE do all the hard work.
My objective is, to compile my project to a jar and execute it in the server.
So far, I got my app to run and work on my IDE which is JDev 9.0.3.2 (OLD) and Java version is 1.3.1_01, but when I try to compile to a jar file for some reason the lib doesn't come along.
My code (partially ofc):
Connection con = null;
public Depositos() throws Exception {
System.out.println("Beginning ORACLE DB connection");
try {
String connstr="jdbc:oracle:thin:"+"#<hostname>"+":"+"<port>"+":"+"<SID>";
System.out.println("connstr ok");
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Class.forName ok");
con = DriverManager.getConnection (connstr, "cic", "managercic");
System.out.println("Connection successful");
} catch (ClassNotFoundException e) {
throw new Exception("DB connection error "+e.getMessage());
}
}
And I suspect the problem is over here, more precisely in here:
"Class.forName("oracle.jdbc.driver.OracleDriver"); "
My procedure is:
On the Depositos.java folder
I run this:
javac -verbose Depositos.java -classpath C:\oracle\ora92\jdbc\lib\classes12.jar
the output says it's all OK.
jar cfmv0 Depositos.jar MANIFEST.MF Depositos.class C:\oracle\ora92\jdbc\lib\classes12.jar
my MANIFEST.MF contains:
Manifest-Version: 1.0
Created-By: Oracle JDeveloper 10.1.3.4.0
Main-Class: Depositos.Depositos
When I run the code from the src folder with:
java oic.OIC
my output is:
Beginning ORACLE DB connection
connstr ok
Exception in thread "main" java.lang.Exception: DB connection error oracle.jdbc.driver.OracleDriver
at Depositos.Depositos.<init>(Depositos.java:47)
at Depositos.Depositos.main(Depositos.java:98)
Which leads me to the conclusion that the error is in the line I stated above.
And I don't understand what I did wrong, I've read so many post from other forums, I don't know what's the right move anymore.
I tried several combinations of compiling commands.
Thank you for your help.
You can add the oracle jar to your jar, and put a 'Class-path' attribute in the manifest.
Manifest-Version: 1.0
Created-By: Oracle JDeveloper 10.1.3.4.0
Main-Class: Depositos.Depositos
Class-path: <path to jar inside your jar>
From memory though, if your jar is signed, you need to sign the jars within it also.