JDBC problem [message #41070] |
Tue, 20 May 2003 22:14  |
Eclipse User |
|
|
|
I have a simple java program that gets a JDBC Connection. If I run this
program on a command line it runs fine. However if it is run from the
Eclipse debugger, I get runtime exception. I am wondering how to fix this
problem.
Thanks in advance.
Sridhar
Here is the code fragment I am using:
try {
String sDriver = "oracle.jdbc.driver.OracleDriver";
String sURL = "jdbc:oracle:oci8:@myDb";
String sUsername = "myacct";
String sPassword = "myPwd";
Class.forName( sDriver ).newInstance();
Connection conn = DriverManager.getConnection ( sURL,
sUsername,
sPassword);
}
catch(Exception ex) {ex.printStackTrace();}
Here is the exception I am getting:
ld.so.1: oracleleap: fatal: libskgxp8.so: open failed: No such file or
directory
java.sql.SQLException: ORA-12547: TNS:lost contact
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java: 168)
at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:15 97)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:354)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)
at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(Oracle Driver.java:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:26 0)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
|
|
|
|
|
|
Re: JDBC problem [message #43750 is a reply to message #42518] |
Thu, 22 May 2003 10:56   |
Eclipse User |
|
|
|
Hi,
You set LD_LIBRARY_PATH in .profile (or .bash_profile) like oracle user
btw.
export LD_LIBRARY_PATH=$OARCLE_HOME/lib
Call eclipse after this
You can thin driver,too - then You needn't oracle lib
regards
Harsi Peco
Sridhar wrote:
> Hi,
>
> Many Thanks for your response.
>
> I checked the \"java.library.path\" variable and it does include
> $ORACLE_HOME/lib. However I noticed that the sequence of entries is not
> the same as those in the environment of the shell that launched the
> Eclipse IDE. In otherwords, Eclipse seems to be constructing its own
> LD_LIBRARY_PATH (based on the environment variable). I tried to set
> -Djava.library.path to my LD_LIBRARY_PATH but that did not help. I am
> wondering if there is any way we can specify the environment parameters in
> a config file.
>
> Thanks
>
> Sridhar
>
> snpe wrote:
>
>> Hi,
>> You haven\'t $ORACLE_HOME/lib in LD_LIBRARY_PATH or /etc/ld.so.conf,
>> probably I think that this work like oracle user on command line and then
>> installer set LD_LIBRARY_PATH for you
>
>> regards
>> Haris Peco
>
>> Sridhar wrote:
>
>> > I have a simple java program that gets a JDBC Connection. If I run this
>> > program on a command line it runs fine. However if it is run from the
>> > Eclipse debugger, I get runtime exception. I am wondering how to fix
>> > this problem.
>> >
>> > Thanks in advance.
>> >
>> > Sridhar
>> >
>> > Here is the code fragment I am using:
>> > try {
>> > String sDriver = \"oracle.jdbc.driver.OracleDriver\";
>> > String sURL = \"jdbc:oracle:oci8:@myDb\";
>> > String sUsername = \"myacct\";
>> > String sPassword = \"myPwd\";
>> >
>> > Class.forName( sDriver ).newInstance();
>> > Connection conn = DriverManager.getConnection ( sURL,
>> > sUsername,
>> > sPassword);
>> > }
>> > catch(Exception ex) {ex.printStackTrace();}
>> >
>> > Here is the exception I am getting:
>> >
>> > ld.so.1: oracleleap: fatal: libskgxp8.so: open failed: No such file or
>> > directory
>> > java.sql.SQLException: ORA-12547: TNS:lost contact
>> >
>> > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java: 168)
>> > at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:15 97)
>> > at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:354)
>> > at
>> > oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)
>> > at
>> >
>>
oracle.jdbc.driver.OracleDriver.getConnectionInstance(Oracle Driver.java:365)
>> > at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:26 0)
>> > at java.sql.DriverManager.getConnection(DriverManager.java:517)
>> > at java.sql.DriverManager.getConnection(DriverManager.java:177)
|
|
|
Re: JDBC problem [message #46431 is a reply to message #43750] |
Fri, 23 May 2003 13:26   |
Eclipse User |
|
|
|
Hi,
Many Thanks for the suggestions.
I tried all the possible combinations. Looks like there is a fundamental
problem with eclipse being able to locate and load a library from the
LD_LIBRARY_PATH.
One of our friends was able to use an Oracle driver and it seems to be
fine.
I observed an interesting behavior, when I used
-Djava.library.path=$ORACLE_HOME/lib:$MY_LD_LIBRARY_PATH, it was able to
load oracle library, however it was complaining about another library file
not (one of our shared libs located) found (same error message as before
but complaining about a different library). Without Oracle stuff eclipse
loads our library fine.
Thanks
Sridhar
snpe wrote:
> Hi,
> You set LD_LIBRARY_PATH in .profile (or .bash_profile) like oracle user
> btw.
> export LD_LIBRARY_PATH=$OARCLE_HOME/lib
> Call eclipse after this
> You can thin driver,too - then You needn't oracle lib
> regards
> Harsi Peco
> Sridhar wrote:
> > Hi,
> >
> > Many Thanks for your response.
> >
> > I checked the \"java.library.path\" variable and it does include
> > $ORACLE_HOME/lib. However I noticed that the sequence of entries is not
> > the same as those in the environment of the shell that launched the
> > Eclipse IDE. In otherwords, Eclipse seems to be constructing its own
> > LD_LIBRARY_PATH (based on the environment variable). I tried to set
> > -Djava.library.path to my LD_LIBRARY_PATH but that did not help. I am
> > wondering if there is any way we can specify the environment parameters in
> > a config file.
> >
> > Thanks
> >
> > Sridhar
> >
> > snpe wrote:
> >
> >> Hi,
> >> You haven\'t $ORACLE_HOME/lib in LD_LIBRARY_PATH or /etc/ld.so.conf,
> >> probably I think that this work like oracle user on command line and then
> >> installer set LD_LIBRARY_PATH for you
> >
> >> regards
> >> Haris Peco
> >
> >> Sridhar wrote:
> >
> >> > I have a simple java program that gets a JDBC Connection. If I run this
> >> > program on a command line it runs fine. However if it is run from the
> >> > Eclipse debugger, I get runtime exception. I am wondering how to fix
> >> > this problem.
> >> >
> >> > Thanks in advance.
> >> >
> >> > Sridhar
> >> >
> >> > Here is the code fragment I am using:
> >> > try {
> >> > String sDriver = \"oracle.jdbc.driver.OracleDriver\";
> >> > String sURL = \"jdbc:oracle:oci8:@myDb\";
> >> > String sUsername = \"myacct\";
> >> > String sPassword = \"myPwd\";
> >> >
> >> > Class.forName( sDriver ).newInstance();
> >> > Connection conn = DriverManager.getConnection ( sURL,
> >> > sUsername,
> >> > sPassword);
> >> > }
> >> > catch(Exception ex) {ex.printStackTrace();}
> >> >
> >> > Here is the exception I am getting:
> >> >
> >> > ld.so.1: oracleleap: fatal: libskgxp8.so: open failed: No such file or
> >> > directory
> >> > java.sql.SQLException: ORA-12547: TNS:lost contact
> >> >
> >> > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java: 168)
> >> > at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:15 97)
> >> > at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:354)
> >> > at
> >> > oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)
> >> > at
> >> >
> >>
> oracle.jdbc.driver.OracleDriver.getConnectionInstance(Oracle Driver.java:365)
> >> > at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:26 0)
> >> > at java.sql.DriverManager.getConnection(DriverManager.java:517)
> >> > at java.sql.DriverManager.getConnection(DriverManager.java:177)
|
|
|
Re: JDBC problem [message #46623 is a reply to message #46431] |
Fri, 23 May 2003 17:19  |
Eclipse User |
|
|
|
Hi Sridhar,
Oracle lib isn't java lib.You must LD_LIBRARY_PATH out of eclipse (before
run eclipse) with :
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
run eclipse
or in .bash_profile
It is better that edit /etc/ld.so.conf (must be root) and add line :
/usr/oracle/lib
change /usr/oracle with ORACLE_HOME and call
ldconfig
then start eclipse
You must use thin JDBC driver URL like
jdbc:oracle:thin:user/password@hostname:1521:SID
then , You must set Oracle Net on port 1521 and sid SID
You must add jdbc jar in eclipse, too
regards
Haris Peco
Sridhar wrote:
> Hi,
>
> Many Thanks for the suggestions.
>
> I tried all the possible combinations. Looks like there is a fundamental
> problem with eclipse being able to locate and load a library from the
> LD_LIBRARY_PATH.
>
> One of our friends was able to use an Oracle driver and it seems to be
> fine.
>
> I observed an interesting behavior, when I used
> -Djava.library.path=$ORACLE_HOME/lib:$MY_LD_LIBRARY_PATH, it was able to
> load oracle library, however it was complaining about another library file
> not (one of our shared libs located) found (same error message as before
> but complaining about a different library). Without Oracle stuff eclipse
> loads our library fine.
>
> Thanks
>
> Sridhar
>
>
> snpe wrote:
>
>> Hi,
>> You set LD_LIBRARY_PATH in .profile (or .bash_profile) like oracle user
>> btw.
>> export LD_LIBRARY_PATH=$OARCLE_HOME/lib
>> Call eclipse after this
>> You can thin driver,too - then You needn't oracle lib
>
>> regards
>> Harsi Peco
>> Sridhar wrote:
>
>> > Hi,
>> >
>> > Many Thanks for your response.
>> >
>> > I checked the \"java.library.path\" variable and it does include
>> > $ORACLE_HOME/lib. However I noticed that the sequence of entries is not
>> > the same as those in the environment of the shell that launched the
>> > Eclipse IDE. In otherwords, Eclipse seems to be constructing its own
>> > LD_LIBRARY_PATH (based on the environment variable). I tried to set
>> > -Djava.library.path to my LD_LIBRARY_PATH but that did not help. I am
>> > wondering if there is any way we can specify the environment parameters
>> > in a config file.
>> >
>> > Thanks
>> >
>> > Sridhar
>> >
>> > snpe wrote:
>> >
>> >> Hi,
>> >> You haven\'t $ORACLE_HOME/lib in LD_LIBRARY_PATH or /etc/ld.so.conf,
>> >> probably I think that this work like oracle user on command line and
>> >> then installer set LD_LIBRARY_PATH for you
>> >
>> >> regards
>> >> Haris Peco
>> >
>> >> Sridhar wrote:
>> >
>> >> > I have a simple java program that gets a JDBC Connection. If I run
>> >> > this program on a command line it runs fine. However if it is run
>> >> > from the Eclipse debugger, I get runtime exception. I am wondering
>> >> > how to fix this problem.
>> >> >
>> >> > Thanks in advance.
>> >> >
>> >> > Sridhar
>> >> >
>> >> > Here is the code fragment I am using:
>> >> > try {
>> >> > String sDriver = \"oracle.jdbc.driver.OracleDriver\";
>> >> > String sURL = \"jdbc:oracle:oci8:@myDb\";
>> >> > String sUsername = \"myacct\";
>> >> > String sPassword = \"myPwd\";
>> >> >
>> >> > Class.forName( sDriver ).newInstance();
>> >> > Connection conn = DriverManager.getConnection ( sURL,
>> >> > sUsername,
>> >> > sPassword);
>> >> > }
>> >> > catch(Exception ex) {ex.printStackTrace();}
>> >> >
>> >> > Here is the exception I am getting:
>> >> >
>> >> > ld.so.1: oracleleap: fatal: libskgxp8.so: open failed: No such file
>> >> > or directory
>> >> > java.sql.SQLException: ORA-12547: TNS:lost contact
>> >> >
>> >> > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java: 168)
>> >> > at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:15 97)
>> >> > at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:354)
>> >> > at
>> >> >
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)
>> >> > at
>> >> >
>> >>
>>
oracle.jdbc.driver.OracleDriver.getConnectionInstance(Oracle Driver.java:365)
>> >> > at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:26 0)
>> >> > at java.sql.DriverManager.getConnection(DriverManager.java:517)
>> >> > at java.sql.DriverManager.getConnection(DriverManager.java:177)
|
|
|
Re: JDBC problem [message #46802 is a reply to message #46431] |
Fri, 23 May 2003 15:09  |
Eclipse User |
|
|
|
In article <ballk3$17b$1@rogue.oti.com>, kundurs@yahoo.com (Sridhar) wrote:
> <snip>
> Looks like there is a fundamental
> problem with eclipse being able to locate and load a library from the
> LD_LIBRARY_PATH.
> </snip>
>
I do this with other libraries regularly. If you believe there is a
problem, please enter a bugzilla report describing your situation in
detail.
Thanks,
McQ.
|
|
|
Powered by
FUDForum. Page generated in 0.04508 seconds