LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-04-2008, 06:55 PM   #1
epmd_shell
LQ Newbie
 
Registered: Feb 2008
Posts: 5

Rep: Reputation: 0
JDBC HELP in REDHAT


Hi,
I have a Database program called CACHE. I need to enable JDBC connectivity to an ORACLE10G server. The CACHE box will be serving as the client. and connecting to the oracle box via JDBC. Now i've tested this in windows so it's not a syntax issue or a database issue. It's something i'm missing in the linux box and i'm a bit frustrated. Can someone lead me in the right away? Like what variables to use and what paths to set. I"ve set many and tried many but no luck. I also added a CLASSPATH but no luck.

Thanks
 
Old 02-04-2008, 07:48 PM   #2
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
What does your classpath look like? Which file did you set it in? Have you considered using the jpackage.org jdbc package?
 
Old 02-05-2008, 10:12 AM   #3
epmd_shell
LQ Newbie
 
Registered: Feb 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Ok here are a few more details, the CACHE application has a system management portal (SMP) and has the following requirements:
Connection Name: ODSD (Simple, we can call it "ODSD")
User Name: USERNAME
PASS: PASS
Driver Nameracle.jdbc.driver.OracleDriver
URL:jdbcracle:thin:@//cscdrdbd2v.csmc.edu:1533/ODSD.world
CLASS PATH:/app/oracle/product/jdbc/lib/ojdbc14.jar (this clearly states from the vendor to point to the JAR file that will enable jdbc connectivity to the oracle box, i tested this on a windows box and it worked fine)

The only thing i can think of is that there is a bunch of java installs on this machine, from oracle, from the distribution, and an additional latest one that i put on to test if java was having issues. I'm not 100% sure that java is working or able to run as i opened a browser to a java page and got a download request from firefox but that could have just been firefox not linked to the proper libraries.

Any assistance would be appreciated. The settings named above work just fine on a windows box (amazingly) with the file location of the *.jar file being on a c:\ format.

The CLASSPATH VAR in a windows box points to a java qt zip file if it helps. I'm not new to Linux as i'm a Linux Engineer here and we're trying to move (cuz i want this application on linux) from aix to linux and if this works TADA!

Power to us!

Thanks
 
Old 02-05-2008, 10:28 AM   #4
epmd_shell
LQ Newbie
 
Registered: Feb 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Just to make it clear, the CACHE application is a flat file database program from intersystems.com.

THANKS!
 
Old 02-05-2008, 12:51 PM   #5
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
OK, let's first check your java. The goold old which java and java -version should give you some pointers. You can also switch from one jdk/jre to another by using the update-alternatives --config java set of commands. There is also a GUI application called galternatives that will allow you to do that much faster.

If you are using a jdk/jre other than those provided by your distribution, you'll have to set your JAVA_HOME and J2RE_HOME variables in .(bash_)profile or /etc/profile. Make sure that the jdbc jar is properly exported. You may also need to set the LD_LIBRARY path to include that jar. And are you sure that CACHE is located in a directory that is in your PATH?
 
Old 02-06-2008, 10:44 AM   #6
epmd_shell
LQ Newbie
 
Registered: Feb 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for your reply, i honestly think it might be that the system does not know how to start JAVA. I think CACHE calls java locally and that's where it's not working. I've pasted my java version which is supported by JDBC on CACHE, my ENV, and my JAVA alternatives. The jar file for jdbc i'm using is ojdbc14.jar that came with the oracle10g client. That's the classpath i'm using. I think maybe i should switch to the java provided by the oracle client? Also, the funny thing is that this works on my desktop windows box so i know the JDBC functionality works for Cache. The intersys folks themselves are trying to figure this out. I think it's A. a java issue or B. a CACHE bug until they prove to me they have a working linux box connecting via JDBC to an ORACLE DB. Hopefully this helps you guys understand my situation better. Thanks again!

##############JAVA VERSION##############
[root@cslxhiep1 Backup]# java -version
java version "1.4.2"
gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)

##############################################
#############CURRENT ENV#######################
[root@cslxhiep1 Backup]# env
HOSTNAME=cslxhiep1.csmc.edu
SHELL=/bin/bash
TERM=vt100
HISTSIZE=1000
USER=root
LD_LIBRARY_PATH=/app/oracle/product/jdbc/lib/
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36i=40;33:so=01;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi= 01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01 ;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz =01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;3 5:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
KDEDIR=/usr
MAIL=/var/spool/mail/root
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
INPUTRC=/etc/inputrc
PWD=/ensemble/mgr/Backup
JAVA_HOME=/app/oracle/product/jdk/bin
LANG=en_US.UTF-8
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=1
HOME=/root
LOGNAME=root
CLASSPATH=/app/oracle/product/jdbc/lib/ojdbc14.jar
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1

_=/bin/env

##########CURRENT ALTERNATIVES FOR JAVA##############
[root@cslxhiep1 Backup]# alternatives --display java
java - status is auto.
link currently points to /usr/lib/jvm/jre-1.4.2-gcj/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
slave jre: /usr/lib/jvm/jre-1.4.2-gcj
slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java.
[root@cslxhiep1 Backup]#
 
Old 02-06-2008, 01:02 PM   #7
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
I don't know whether this has anything to do with it but you do have a mixed environment. Your JAVA_HOME points to the Oracle jdk while your system is set to use gcj. On top of that, gcj 1.4.2 may not be quite up to snuff now that we are approaching java 1.7.
I would recommend that you vist Sun and download a more recent jdk or jre. Then visit jpackage.org for instructions on making it integrate properly with your Red Hat system so that you can switch your java environment with a few simple clicks (if you don't, you will have to create all the bindings manually - I have a little script to do that but it's still better to use the jpackage approach).
 
Old 02-06-2008, 01:29 PM   #8
epmd_shell
LQ Newbie
 
Registered: Feb 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Do you think i should use the alternatives java for JAVA_HOME and move my jar file to the lib location of that java as well for classpath?
 
Old 02-06-2008, 02:44 PM   #9
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
That is one option although, as said, it may be more interesting to go the other way round and switch from gcj to something more up-to-date. I occasionally use Oracle jdeveloper (coupled with Oracle 10g) and its documentation insists that one use at least java 1.5. If you use 1.4.2, you may solve your problems with CACHE only to see new ones spring up on the Oracle side of things (Note that I'm being tentative here - I can' tell for certain but it does seem reasonable).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Jdbc apffal Linux - General 0 10-07-2004 12:37 PM
help with my JDBC Driver working2hard Programming 2 07-27-2004 10:18 AM
postgresql+jdbc in redhat 7.3 need help pleaseee!! Sridhar Guntur Linux - Software 0 10-22-2002 12:19 AM
jdbc mysql Redhat 7.2 problem johnlee Linux - General 1 04-23-2002 06:34 PM
MySQL and JDBC oulevon Programming 1 07-16-2001 06:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration