是不是该jdbc:db2://172.16.2.213:50000/awmts ? 感觉端口号弄错了,瞎猜的.
解决方案 »
- 郁闷,程序运行一段时间后页面显示不正常了,删除tomcat下work文件夹下的内容后又正常了,为啥这是
- hibernate的问题!!
- struts跳转问题
- 请教在jsp中,iframe页面和include 页面,为什么include的样式可以显示,但是iframe的页面样式无法正常显示?
- Tomcat问题:Document base does not exist or is not a readable directory
- 请问JAVA的日期时间相减问题,急
- 可以实现在jsp网页中,插入aspx的内容吗
- 请教:怎样查看JSP编译生成的JAVA文件?
- 快帮忙,紧急!!!
- 日期类型转化问题
- 如何判断rtsp连接是否连通?
- JAVA 精英 meeting, 请进
This access requires DB2 Client-software (DB-Connect) installed on the local machine (the computer where tomcat runs).
To use this access, you must call the Client-Configuration programm of DB2 and make a local name for the Database you want to access.
Now you can open it in JDBC with the url jdbc:db2:<local-databasename>
By the way: having given the name, you could also acces it via the jdbc-odbc bridge.2) The alternative way is to connect via the COM.ibm.db2.jdbc.net.DB2Driver
This access is designed for easy-to-deploy clients tlike applets or stand-alone clients where an installation of the (native) DB2-client is too complicated. (In fact it is)
Access is slower compared to the app-driver.
To be able to use it, you must run the db2jstrt <portnumber> command on the DB-Server. (NOT on the computer, where the tomcat runs., but on the computer, where DB2 runs).
To run this command, there are two ways (you must do it physically on the db2-server):
-just open a DB2-console (you find it in the task-bar) and type the command
-if you don't find the DB2-console on the task bar: open a console and navigate to the IBM-installation/SQLLIB/bin directory and type the commandAfter that, you can JDBC connect with the net-driver via the url
jdbc:db2:/<DB2-server-IP>:<tport-number>/<database-name>
<port-number> is the number, you used with the db2jstrt commandclearly for a webserver, the natural choice would be the app-driver第一种我建了一个别名,搞定,第二种还没完成,我觉得应该是db2jstrt <portnumber>时有问题,我直接db2jstrt 50000(是数据库的端口号)。
建议你使用这个包看看com.ibm.db2.jcc.DB2Driver
当db2是架在aix/unix上面时,注意web容器类库使用的不是db2jcc.jar,而是db2jcc_javax.jar和jb2jcc_license_cu.jar ,同样在ibm/sqllib/java/目录下