用于连接多个数据库的Jython安装

开发 后端
本文简单介绍了用于连接多个数据库的Jython安装步骤。

本Jython安装例子主要是针对Jython需要连接多个数据库(Oracle和TimesTen)来写。

Jython安装前提:

1、本用户下,可以通过sqlplus连接Oracle,也就是Oracle的客户端安装完整,环境变量设置正确。

2、本用户下,可以通过ttisqlcs连接TimesTen数据库,则表示TimesTen的客户端安装完成,环境变量正确。

3、JDK要求版本在1.4以上,最好是1.5版本以上。

Jython安装工作的主要目标:

Jython运行依赖JDK,所以必须要设置JDK的路径。

Jython要连接Oracle,当然必须要告知Jython,Oracle JDBC所在的路径(一般在ORACLE_HOME/jdbc下)。

要连接TimesTen,也必须要告知Jython,TimesTen JDBC所在的路径(一般在TT_HOME/lib下)。

JDBC路径下一般有多个版本的JDBC jar包文件,建议使用和JDK版本一致的,如果相同版本没有,则选择小一号的版本。

详细Jython安装步骤:

第一步:安装指令:java -jar jython_installer-2.2.1.jar --console

  1. Welcome to Jython !  
  2. You are about to install Jython version 2.2.1  
  3. (at any time, answer c to cancel the installation)  
  4. For the installation process, the following languages are available: English, German  
  5. Please select your language [e/g] >>> e  
  6. Do you want to read the license agreement now ? [y/n] >>> n  
  7. Do you accept the license agreement ? [y/n] >>> y  
  8. The following installation types are available:  
  9.  1. All (everything, including sources)  
  10.  2. Standard (core, library modules, demos and examples, documentation)  
  11.  3. Minimum (core)  
  12.  9. Standalone (a single, executable .jar)  
  13. Please select the installation type [1/2/3/9] >>> 1  
  14. Do you want to exclude parts from the installation ? [y/n] >>> n  
  15. Please enter the target directory >>> /home/lsabm/jy  
  16. Unable to find directory /home/lsabm/jy, create it ? [y/n] >>> y  
  17. Please enter the target java home directory (== for current) >>> /usr/java5_64  
  18. Checking java version ...  
  19. Your java version to start Jython is: IBM Corporation / 1.5.0  
  20. Please press Enter to proceed >>>   
  21. Your operation system version is: AIX / 5.3  
  22. This operating system might not be fully supported.  
  23. Please press Enter to proceed anyway >>>   
  24. Summary:  
  25.  - mod: true  
  26.  - demo: true  
  27.  - doc: true  
  28.  - src: true  
  29.  - JRE: /usr/java5_64  
  30. Please confirm copying of files to directory /home/lsabm/jy [y/n] >>> y  
  31. 10 %  
  32. 20 %  
  33. 30 %  
  34. 40 %  
  35. 50 %  
  36. 60 %  
  37. 70 %  
  38. 80 %  
  39. 90 %  
  40. 100 %  
  41. Generating start scripts ...  
  42. 100 %  
  43. Do you want to show the contents of README ? [y/n] >>> n  
  44. Congratulations! You successfully installed Jython 2.2.1 to directory /home/lsabm/jy. 

第二步:配置java、oracle jdbc和tt jdbc路径。

cd jython安装路径

vi jython  (下面是jython文件的内容,加粗部分是需要确认路径是否正确的)

  1. #!/bin/sh  
  2. # This file was generated by the Jython installer  
  3. # Created on Tue Apr 28 10:35:21 CDT 2009 by lsabm  
  4.  
  5. CP="$ORACLE_HOME/jdbc/ojdbc4.jar:$TT_HOME/lib/ttjdbc5.jar:/home/lsabm/jython/jython.jar" 
  6. if [ ! -z "$CLASSPATH" ]  
  7. then  
  8.   CP=$CP:$CLASSPATH  
  9. fi  
  10. "/usr/java5_64/bin/java" -Dpython.home="/home/lsabm/jython" -classpath "$CP" org.python.util.jython "$@" 

【编辑推荐】

  1. Jython的安装以及使用JDBC驱动程序连接DB2
  2. Hibernate访问多个数据库
  3. JDBC事务处理机制探秘
  4. 使用JDBC的五个精华功能
  5. Tomcat5+MySQL JDBC连接池配置
责任编辑:周立方 来源: 新浪博客
相关推荐

2009-07-16 11:04:17

Jython连接数据库

2023-10-29 17:15:57

2009-07-15 16:29:39

Jython连接JavJavaUtils模块

2009-07-02 09:35:02

hibernate访问

2009-09-28 13:33:48

Hibernate访问

2009-12-23 09:40:53

ADO对象模型

2011-03-24 16:01:30

数据库管理

2010-04-19 10:00:02

Oracle SQL

2009-07-15 18:01:53

Jython数据库

2009-07-16 13:09:46

Jython安装

2023-12-29 22:39:25

Golang应用程序数据库

2024-01-30 15:29:20

Django数据库Python

2010-06-07 15:24:34

Java连接MYSQL

2010-03-18 15:09:15

python数据库连接

2010-10-26 15:54:02

连接oracle数据库

2020-09-22 15:56:31

Java

2009-09-25 13:18:15

Hibernate数据

2011-05-26 13:42:50

MFC连接MySql数据库

2010-08-04 10:42:08

Flex数据库

2010-10-12 12:00:42

MySQL连接
点赞
收藏

51CTO技术栈公众号