Select to view content in your preferred language

ArcSDE 9.3 Direct Connection with Oracle

4621
10
06-03-2011 01:58 PM
KhoaTran1
Emerging Contributor
Hi everyone,

I'm writing code in Java to get direct connection to an Oracle database but unsuccessfully. I've looked around and looked for a solution for almost a week but unable to find one. Hopefully someone here can help me with this.

Server: Enterprise Geodatabase in Oracle 10g, ArcSDE 9.3.1, ArcGIS 9.3.1

I've installed ArcGIS 9.3.1 and ArcSDE931 SDK on my client computer [Windows 7 32-bit]. I also set the SDEHOME, ORAHOME [and also tried ORACLE_HOME], as well as add %SDEHOME%/bin and %ORAHOME%/bin to my path. I also set the TNS_ADMIN to %ORAHOME%/NETWORK/ADMIN. I downloaded both "10201_client_win32" (i.e. Oracle Client 10g) and "10203_vista_w2k8_x86_production_client" (i.e. Oracle Client 10g for Win 7) from Oracle download site and custom installed all the possible softwares that it has on the list. Then, I tried to test the connection based on this instruction http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=Setting_up_clients_for_a_direct_connec...
and stuck with the 2nd step: sqlplus <user name>/<password>@<Oracle Net service name>. The message error I received was "ORA-12560: TNS: protocol adapter error." I think I got this error because Oracle service is not running. But since I only installed Oracle Client, I don't think the Oracle service is supposed to be there and thus doing "lsnrctl" in the command line does not work.

Anyway, I went ahead and wrote some Java code. And I've never got passed this one line [conn = new SeConnection(server, instance, database, user, password);].

SeConnection conn = null;
try {
  System.out.println("Connecting");
  conn = new SeConnection(server, "sde:oracle10g", database, user, password);
  System.out.println("Connected");
} catch (SeException e) {
   _log.error(e.getMessage());
   _log.error(e.getSeError().getErrDesc());
   _log.error(e.getSeError().getSdeErrMsg());
}

The error message that I received was:
Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: com.esri.sde.sdk.client.JGsrvr.gsrvrGetErrorCode(J)I
at com.esri.sde.sdk.client.JGsrvr.gsrvrGetErrorCode(Native Method)
at com.esri.sde.sdk.client.JGsrvr.run(Unknown Source)

I googled the error and it seems like no one's got it yet. According to my understanding the "java.lang.UnsatisfiedError" occurred when the library is not properly linked. However, I've checked all the ArcSDE jar files and required dll in the %SDEHOME% and they're all there.

Does any of you have the solution for this?
0 Kudos
10 Replies
VinceAngelo
Esri Esteemed Contributor
Technically, you don't need ArcGIS installed to develop or deploy ArcSDE applications
(either Java or 'C' API).  In practice, it's useful for developers to have access to the
ArcSDE administration binaries ('sdelayer', 'sdetable', etc) in an ArcSDE for {DBMS}
installation, but once the application is compiled, then you only need one ArcSDE
client install (which includes ArcGIS Desktop and Server, the SDK, and all ArcSDE
server installations).

- V
0 Kudos