Вы находитесь на странице: 1из 5

GROUPOFBASIS (http://www.groupofbasis.com) All of SAP Basis Consult Home (http://www.groupofbasis.com/) About (http://www.groupofbasis.com/about-2/) Contact us (http://www.groupofbasis.com/contact-us-2/) Services (http://www.groupofbasis.

com/services/) Type your search

KEEP IN TOUCH
(http://www.groupofbasis.com/feed/rss/) (http://facebook.com/groupofbasis)

GO

SAP Jco : Easy to setup step by step (example)


Jan23 2011 (http://www.groupofbasis.com/sap-jco-easy-to-setup-step-by-step-example/) Leave a Comment (http://www.groupofbasis.com/sap-jco-easy-to-setup-step-by-step-example/#respond) Written by Suwatchai
(http://www.groupofbasis.com/author/suwatchai/)

Neccessary files 1. libsapjco3.so 2. sapjco3.jar 3. /oracle/PRD/102_64/jdbc/lib/nls_charset12.jar 4. /oracle/PRD/102_64/jdbc/lib/ojdbc14.jar Step to step : 1. Check JAVA VM (if Java Connector 3 up will run on JAVA 1.5 up) SAP-SERVER:oraprd 46% java -version java version 1.5.0_12 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04) Java HotSpot(TM) Server VM (build 1.5.0_12-b04, mixed mode) 2. Cretae SAPJco folder and put require files on folder SAP-SERVER:oraprd 50% pwd /oracle/PRD/SAPJco SAP-SERVER:oraprd 49% ls -al total 13608 drwxr-xr-x 3 oraprd dba 512 Feb 12 17:47 . drwxr-xr-x 23 oraprd dba 1536 Feb 12 16:06 .. drwxr-xr-x 2 oraprd dba 512 Feb 12 17:48 jco_server -rw-rr 1 oraprd dba 5784736 Feb 12 17:47 libsapjco3.so -rw-rr 1 oraprd dba 1149431 Feb 12 17:47 sapjco3.jar 3. Create folder for application (jco_server) and put source files (.java) in here SAP-SERVER:oraprd 58% pwd

/oracle/PRD/SAPJco/jco_server SAP-SERVER:oraprd 59% ls -al total 24 drwxr-xr-x 2 oraprd dba 512 Feb 12 17:48 . drwxr-xr-x 3 oraprd dba 512 Feb 12 17:47 .. -rw-rr 1 oraprd dba 9650 Feb 12 17:48 JCO_SERVER.java 4. modify JCO_SERVER.java connect to other host Example : Properties connectProperties = new Properties(); connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST,SAP-SERVER); connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, 03); connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, 900); connectProperties.setProperty(DestinationDataProvider.JCO_USER, inf01); connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, sapcpic); connectProperties.setProperty(DestinationDataProvider.JCO_LANG, th); connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY, 3); connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT, 10); createDataFile(DESTINATION_NAME2, jcoDestination, connectProperties); Properties servertProperties = new Properties(); servertProperties.setProperty(ServerDataProvider.JCO_GWHOST,SAP-SERVER); servertProperties.setProperty(ServerDataProvider.JCO_CONNECTION_COUNT, 2); servertProperties.setProperty(ServerDataProvider.JCO_GWSERV, sapgw00); servertProperties.setProperty(ServerDataProvider.JCO_PROGID, JCO_SERVER); servertProperties.setProperty(ServerDataProvider.JCO_REP_DEST, ABAP_AS_WITH_POOL); createDataFile(SERVER_NAME1, jcoServer, servertProperties); String url = jdbc:oracle:thin:@EXTERNAL-SERVER:1521:PROD; String userName = user; String password = passwd; 5. Check environment SAP-SERVER:oraprd 72% env HOME=/oracle/PRD PATH=/oracle/PRD/102_64/bin:/oracle/PRD:/usr/sap/PRD/SYS/exe/run:/usr/bin:.:/usr/ccs/bin:/usr/ucb LOGNAME=oraprd HZ= TERM=vt100 SHELL=/bin/csh MAIL=/var/mail/oraprd TZ=Asia/Bangkok PWD=/oracle/PRD/SAPJco/jco_server USER=oraprd SAPSYSTEMNAME=PRD DIR_LIBRARY=/usr/sap/PRD/SYS/exe/run LD_LIBRARY_PATH=/usr/sap/PRD/SYS/exe/run:/oracle/PRD/102_64/lib THREAD=NOPS dbms_type=ORA dbs_ora_tnsname=PRD dbs_ora_schema=SAPSR3

ORACLE_SID=PRD DB_SID=PRD ORACLE_BASE=/oracle ORACLE_HOME=/oracle/PRD/102_64 NLS_LANG=AMERICAN_AMERICA.UTF8 SAPDATA_HOME=/oracle/PRD 6. Add CLASSPATH and LD_LIBRARY_PATH set environment CLASS_PATH (for c shell) % setenv CLASSPATH .:/oracle/PRD/SAPJco/sapjco3.jar:/oracle/PRD/102_64/jdbc/lib/ojdbc14.jar:/oracle/PRD/102_64 /jdbc/lib/nls_charset12.jar:/oracle/PRD/SAPJco/jco_server add JCO path to LD_LIBRARY_PATH % setenv LD_LIBRARY_PATH /oracle/PRD/SAPJco:$LD_LIBRARY_PATH Tips : unset environment unsetenv CLASSPATH !!! Set this environment to logon environment too 7. Compile sorce code SAP-SERVER:oraprd 64% cd /oracle/PRD/SAPJco/jco_server SAP-SERVER:oraprd 59% ls -al total 24 drwxr-xr-x 2 oraprd dba 512 Feb 12 17:48 . drwxr-xr-x 3 oraprd dba 512 Feb 12 17:47 .. -rw-rr 1 oraprd dba 9650 Feb 12 17:48 JCO_SERVER.java SAP-SERVER:oraprd 66% javac -classpath .:/oracle/PRD/SAPJco/sapjco3.jar:/oracle/PRD/102_64/jdbc/lib/ojdbc14.jar: /oracle/PRD/102_64/jdbc/lib/nls_charset12.jar:/oracle/PRD/SAPJco/jco_server JCO_SERVER.java SAP-SERVER:oraprd 69% ls -al total 42 drwxr-xr-x 2 oraprd dba 512 Feb 13 10:58 . drwxr-xr-x 3 oraprd dba 512 Feb 12 17:47 .. -rw-rr 1 oraprd dba 538 Feb 13 10:58 JCO_SERVER$MyStateChangedListener.class -rw-rr 1 oraprd dba 769 Feb 13 10:58 JCO_SERVER$MyThrowableListener.class -rw-rr 1 oraprd dba 2695 Feb 13 10:58 JCO_SERVER$StfcConnectionHandler.class -rw-rr 1 oraprd dba 3772 Feb 13 10:58 JCO_SERVER.class -rw-rr 1 oraprd dba 9650 Feb 12 18:01 JCO_SERVER.java 8. run application $ java -d64 JCO_SERVER & or $ nohup java -d64 JCO_SERVER & Share on Facebook (http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.groupofbasis.com%2Fsap-jcoeasy-to-setup-step-by-stepexample%2F&t=SAP%20Jco%20%3A%20Easy%20to%20setup%20step%20by%20step%20%28example%29)

Posted in O.S. (http://www.groupofbasis.com/category/o-s/) - Tagged SAP Jco


(http://www.groupofbasis.com/tag/sap-jco/)

SHARE THIS Twitter (http://twitter.com/home?status=SAP Jco : Easy to setup step by step

(example)++http://tinyurl.com/4yuomh4) Facebook (http://www.facebook.com/share.php? u=http://www.groupofbasis.com/sap-jco-easy-to-setup-step-by-step-example/&t=SAP Jco : Easy to setup step by step (example)) Delicious (http://del.icio.us/post?url=http://www.groupofbasis.com/sap-jco-easy-to-setup-step-by-stepexample/&title=SAP Jco : Easy to setup step by step (example)) StumbleUpon (http://www.stumbleupon.com/submit? url=http://www.groupofbasis.com/sap-jco-easy-to-setup-step-by-step-example/&title=SAP Jco : Easy to setup step by step (example)) E-mail (http://www.addtoany.com/email?linkurl=http://www.groupofbasis.com/sap-jco-easy-to-setupstep-by-step-example/&linkname=SAP Jco : Easy to setup step by step (example)) (http://www.addtoany.com/share_save#url=http://www.groupofbasis.com/sap-jco-easy-to-setup-step-by-stepexample/&linkname=SAP Jco : Easy to setup step by step (example)) Expand role menu for user (http://www.groupofbasis.com/expand-role-menu-for-user/)

SAP Note Viewer for iPhone available (Free) (http://www.groupofbasis.com/sap-note-viewer-for-iphoneavailable-free/)

No Comments Yet
(http://www.groupofbasis.com/sap-jco-easy-to-setup-step-by-step-example/feed/)

Leave a Reply
Your email address will not be published. Required fields are marked * Name * Email * Website

Comment You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title="">
<b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Comment

July 2011

F 1

S 2 9

S 3 10

11 18 25

12 19 26

13 20 27

14 15 16 17 21 22 23 24 28 29 30 31

Jun (http://www.groupofbasis.com/2011/06/)

Meta
Log in (http://www.groupofbasis.com/wp-login.php) Entries RSS (http://www.groupofbasis.com/feed/) Comments RSS (http://www.groupofbasis.com/comments/feed/) WordPress.org (http://wordpress.org/)

Categories
O.S. (http://www.groupofbasis.com/category/o-s/) SAP (http://www.groupofbasis.com/category/sap/) SAP portal (http://www.groupofbasis.com/category/sap-portal/)

Recent Posts
JOB PRE-SALE (http://www.groupofbasis.com/job-pre-sale/) Urgent JOB on ORACLE DBA (http://www.groupofbasis.com/urgent-job-on-oracle-dba/) Urgent JOB on FI,SD,PP,MM,QM,PM (http://www.groupofbasis.com/urgent-job-on-fisdppmmqmpm/) J2EE : JCmon monitor menu example (http://www.groupofbasis.com/j2ee-jcmon-monitor-menu-example/) Solaris : zip and compress files (http://www.groupofbasis.com/solaris_zip_and_compress-files/)

Archives
June 2011 (http://www.groupofbasis.com/2011/06/) May 2011 (http://www.groupofbasis.com/2011/05/) March 2011 (http://www.groupofbasis.com/2011/03/) February 2011 (http://www.groupofbasis.com/2011/02/) January 2011 (http://www.groupofbasis.com/2011/01/) December 2010 (http://www.groupofbasis.com/2010/12/) EvoLve (http://theme4press.com/evolve/) theme by Theme4Press Powered by WordPress (http://wordpress.org) GROUPOFBASIS (http://www.groupofbasis.com)
All of SAP Basis Consult

Вам также может понравиться