在Linux下配置Struts中的Oracle数据源
初学Struts,走了很多弯路才配置好 Struts的数据源,现将经验分享给和我一样的新手们,愿大家少走弯路,我使用的是MyEclipse6.5,
初学Struts,走了很多弯路才配置好 Struts的数据源,现将经验分享给和我一样的新手们,愿大家少走弯路,我使用的是MyEclipse6.5,首先,,定义 User Libraries;
在MyEclipse6.5,中选择Window-->Prefernces-->Java-->Build Path-->User Libraries --> New -->
输入 User Library Name为:OracleDrive 选择 OK
然后在列表中选中OracleDrive项然后选择右边的Add JARs 然后选择Oracle 安装路径下的ojdbc14.jar和ojdbc14_g.jar文件点确定。我的文件位置是 /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/jdbc/lib/ (我安装的Oracle 版本是Oracle 10g Express Edition)
重复上面的步骤新建一个名为JDBC的 User Library然后添加commons-pool.jar、commons-dbcp-1.2.2.jar和commons-collections-3.2.jar
这三个文件装了MyEclipes6.5,就有了 ,可以用搜索功能在Eclipse中查找这些文件,然后添加到User Library中。
然后,在项目中添加这两个User Library
在MyEclipse6.5 的项目资源管理器(Package Ex)中,在项目名称上点右建选择Build Path --> Add Libraries-->User Library-->Next 勾选 OracleDrive和JDBC 选择 Finish
最后,配置struts-config.xml
在配置节中加入以下内容:
CODE:
注意jdbc:oracle:thin:@127.0.0.1:1521:XE 中 XE 为Oracle的SID,Oracle 10g Express Edition默认为 XE。
若进行了以上操作
启动TomCat仍然出现 java.lang.ClassNotFoundException: ………………………………
将上面的 ojdbc14.jar,commons-pool.jar、commons-dbcp-1.2.2.jar和commons-collections-3.2.jar
拷贝到TomCat安装路径中的lib文件夹中就可以了,我的是/opt/tomcat6/lib。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Principle analysis and practical exploration of the Struts framework. As a commonly used MVC framework in JavaWeb development, the Struts framework has good design patterns and scalability and is widely used in enterprise-level application development. This article will analyze the principles of the Struts framework and explore it with actual code examples to help readers better understand and apply the framework. 1. Analysis of the principles of the Struts framework 1. MVC architecture The Struts framework is based on MVC (Model-View-Con

Exploring the internal mechanism of the Struts2 framework Struts2 is a popular JavaWeb application framework that is widely used to develop Web applications based on the MVC architecture. It has made a lot of improvements and optimizations based on Struts1, providing more powerful and flexible functions. Before we delve into the inner workings of the Struts2 framework, we need to understand some basic concepts. The core of the Struts2 framework is MVC (Model-View-Controlle

Configuring Linux systems to support the development of intelligent robots and automation equipment Intelligent robots and automation equipment play an important role in the field of modern technology. They can help people complete heavy, dangerous or repetitive work and improve production efficiency and work quality. As a developer, to support the development of these applications, you need to configure the Linux system to correctly run and manage these intelligent robots and automation equipment. This article will introduce how to configure a Linux system to support the development of intelligent robots and automation equipment, and attach

With the popularity of the Internet and smart mobile devices, the development of web applications has become increasingly important. As an excellent cross-platform programming language, Java is favored by developers. In Java back-end development, using the MVC framework can help us improve development efficiency and reduce development costs. This article will introduce the MVC framework development of API using JavaApacheStruts. 1. MVC framework MVC (Model-View-Contro

Configuring Linux systems to support image processing and computer vision development In today's digital age, image processing and computer vision play important roles in various fields. In order to do image processing and computer vision development, we need to make some configurations on our Linux system. This article will show you how to configure your Linux system to support these applications and provide some code examples. 1. Install Python and corresponding libraries Python is a widely used programming language suitable for image processing and computing.

Configuring Linux systems to support distributed database development Introduction: With the rapid development of the Internet, the amount of data has increased dramatically, and the requirements for database performance and scalability are also getting higher and higher. Distributed databases emerged as a solution to this challenge. This article will introduce how to configure a distributed database environment under Linux system to support distributed database development. 1. Install the Linux system First, we need to install a Linux operating system. Common Linux distributions include Ubuntu, CentOS, D

How to configure high-availability container orchestration platform monitoring on Linux With the development of container technology, container orchestration platforms are used by more and more enterprises as an important tool for managing and deploying containerized applications. In order to ensure the high availability of the container orchestration platform, monitoring is a very important part. It can help us understand the operating status of the platform in real time, quickly locate problems, and perform fault recovery. This article will introduce how to configure high-availability container orchestration platform monitoring on Linux and provide relevant code examples. 1. Choose appropriate monitoring tools

The principle of the struts framework: By using Java Servlet/JSP technology, an application framework based on the MVC design pattern of Java EE Web applications is implemented. It uses one or more Action classes to process user requests and return the results to the user. Application of struts framework: 1. Build Web applications; 2. Process form data; 3. Integrate third-party libraries; 4. Implement internationalization; 5. Build RESTful API.
