Sean,

Thanks again.
Our email system went down yesterday, so I don't know what made it out and what did 
not.  But here is another repost
with some additional info.

I finally got the jdbc.oracle.oci stuff working last night.
I just did not want to give up and then dream about it all night.

This required more than the files that where located at:
http://otn.oracle.com/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html
so I'm assuming that a licensed oracle client may be required.
I had to pull other *.so libraries out of the oracle database lib directory.
I'm also assuming that the JDBC-OCI Library driver files that are there must be 
updated/modified versions, but I really
don't know.

Here is what I had to do:

The /opt/coldfusionmx/bin/coldfusion script performs an su command, but I do not think 
it executes the shell script in
the deamon user's home directory.  So I edited the coldfusion script.  Here are the 
areas that I edited:

Begin ColdFusion script:
..
LD_LIBRARY_PATH="$CF_DIR/lib:$CF_DIR/lib/_solaris/bin:/global/apachedg/apache/oracle9i_r2/lib"
#LD_LIBRARY_PATH="$CF_DIR/lib:$CF_DIR/lib/_solaris/bin:/global/oracledg/oracle/app/oracle/product/9.2.0/lib"
ORACLE_HOME="/global/oracledg/oracle/app/oracle/product/9.2.0"
TNS_ADMIN="/var/opt/oracle"
..
CFSTART='su $RUNTIME_USER -c "PATH=$PATH:$CF_DIR/runtime/bin; export PATH; 
LD_LIBRARY_PATH=$LD_LIBRARY_PATH; e
xport LD_LIBRARY_PATH; ORACLE_HOME=$ORACLE_HOME; export ORACLE_HOME; 
TNS_ADMIN=$TNS_ADMIN; export TNS_ADMIN; nohup
$CF_DIR/bin
/cfusion -autorestart -start default &"'
..
End ColdFusion Script

I modified the LD_LIBRARY_PATH in the coldfusion script for reasons we discussed 
earlier.  The Oracle thin client did
not require this.
I then added the TNS_ADMIN variable so the the jdbc-oci could find the tnsnames.ora 
file, but that did not seem to
work.
So then I added the ORACLE_HOME variable because the default location of a 
tnsnames.ora file is
$ORACLE_HOME/network/admin/ and that worked.

Side note: There is an entry in the tnsnames.ora file called an alias which resolves 
to a connect string.  To keep from
having to type the full connect string which is very long, the alias can be used in 
the JDBC URL
(jdbc:oracle:oci:@connect_string_alias).  I suppose you could use the full connect 
string in the JDBC URL.  One could
also assume that the connect string could be used in the field labeled as connect 
string of the DataSource form in the
ColdFusion Administrator.  I have not tried that yet.

This morning I just realized that I could add the "-" in the su command like "su - 
$RUNTIME..." and that should cause
the shell scripts to run.  But I don't know if this would introduce any security 
holes.  I hate having to hack the
coldfusion script because that just adds one more think to the list of stuff to watch 
out for.

I may have missed some details.

Thanks,
Troy

Troy Simpson wrote:

> I think I have is solved.
>
> Inorder to utilized the jdbc-oci drivers I believe that you actually need an Oracle 
>Client.  More binaries are
> required then the ones supplied at:
> http://otn.oracle.com/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html.
> But you can still use the jdbc:oracle:thin client with out the full OracleClient.
>
> I added ORACLE_HOME and TNS_ADMIN in the /opt/coldfusionmx/bin/coldfusion script.
> Here is the sections I changed:
>
> ..
> CF_DIR="/global/apachedg/apache/coldfusionmx"
> #LD_LIBRARY_PATH="$CF_DIR/lib:$CF_DIR/lib/_solaris/bin"
> 
>LD_LIBRARY_PATH="$CF_DIR/lib:$CF_DIR/lib/_solaris/bin:/global/apachedg/apache/oracle9i_r2/lib"
> ORACLE_HOME="/global/oracledg/oracle/app/oracle/product/9.2.0"
> TNS_ADMIN="/var/opt/oracle"
> ...
> CFSTART='su $RUNTIME_USER -c "PATH=$PATH:$CF_DIR/runtime/bin; export PATH; 
>LD_LIBRARY_PATH=$LD_LIBRARY_PATH; e
> xport LD_LIBRARY_PATH; ORACLE_HOME=$ORACLE_HOME; export ORACLE_HOME; 
>TNS_ADMIN=$TNS_ADMIN; export TNS_ADMIN; nohup
> $CF_DIR/bin
> /cfusion -autorestart -start default &"'
>
> The Readme at: 
>http://otn.oracle.com/software/tech/java/sqlj_jdbc/htdocs/jdbc_readme9201.html says 
>this:
> For the JDBC OCI Driver:
> Connection conn = DriverManager.getConnection(
> "jdbc:oracle:oci:@<database>",
> "my_user", "my_password");
> where <database> is either an entry in tnsnames.ora or a SQL*net
> name-value pair.
>
> I thought that <database> was the same as it was for "jdbc:oracle:oci" but it is 
>different.  So I had to figure out
> how to reference the tnsnames.ora file for the connect string.  That is why I added 
>the ORACLE_HOME and TNS_ADMIN
> environment variables.
>
> Can someone valid their finding with mine?
>
> Thanks,
> Troy
>
> Sean A Corfield wrote:
>
> > On Thursday, Oct 17, 2002, at 09:49 US/Pacific, Troy Simpson wrote:
> > > I did this:
> > >
> > > ClassPath: /global/apachedg/apache/oracle9i_r2/classes12.zip
> > >
> > > JDBC URL: jdbc:oracle:thin:@hostname:1521:SID
> > > Driver Class: oracle.jdbc.OracleDriver
> >
> > That is the Thin Client driver, not the OCI driver. But, as you found,
> > it's still faster than the built-in driver.
> >
> > > "The following files are all 100% pure Java and are used with both the
> > > Thin and OCI drivers. To use the OCI driver you must also download the
> > > appropriate
> > > shared library or DLL files."
> >
> > Yes, the OCI drivers use native code for additional speed.
> >
> > > I'm assuming that if I'm using "jdbc:oracle:thin", that I'm not really
> > > using the OCI drivers.
> >
> > Correct. Now that I recall, there were .so files involved and
> > LD_LIBRARY_PATH needed to be set to tell the CFMX executable how to
> > load those those shared libraries when the OCI JDBC driver needs to
> > access them.
> >
> > "I can smell your brains!"
> > -- Mittens the Kitten : http://www.matazone.co.uk/theotherside.html
> >
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to