Weblogic8配置Oracle数据库连接池
1、配置连接池 通过:7001/console进入管理控制台 在左侧菜单中依次进入mydomain(自定义的域名称)-服务-JDBC-连接缓冲池 点击配置新的 JDBC Connection Pool... 数据类型选择:Oracle 数据库驱动程序选择:Oracle's Driver (Thin) Version:9.0.1,0.2.0,10
1、配置连接池 通过:7001/console进入管理控制台
在左侧菜单中依次进入mydomain(自定义的域名称)-服务-JDBC-连接缓冲池
点击“配置新的 JDBC Connection Pool... ”
数据类型选择:Oracle
数据库驱动程序选择:Oracle's Driver (Thin) Version:9.0.1,0.2.0,10
点击右下角的“继续”
在名称中写入想要设置的连接池名称(本例为:myconnection1)
数据库名称:要访问的数据库名称
主机名:写入数据库服务器的主机名称或IP地址(本例:192.168.1.251)
端口号默认为:1521
数据库用户名称、密码根据具体情况填写
点击“继续”
在下一页中点击“测试驱动程序配置”显示“连接成功”
点击“创建和部署”
在新页面的列表中出现myconnection1的配置项
连接池配置完毕
2、测试配置连接池
在左侧菜单中依次进入mydomain(自定义的域名称)-服务-JDBC-连接缓冲池
点击“myconnection1”
在配置页签中点击“连接”页签
点击高级选项“显示”
选择“测试保留连接”,“测试创建连接”,,“测试释放连接”
在“测试表名称”中写入数据库中随便一张表的名称
在“初始SQL”中写入“SQL select * from student”
选择“支持本地事务”选项
点击“应用”
在“测试”页签下点击“测试缓冲池”
显示“测试成功”
3、配置JDBC数据源
在管理控制台左侧菜单中依次进入mydomain(自定义的域名称)-服务-JDBC-数据源
点击“配置新的 JDBC Data Source”
在名称中写入要配置的数据源名称(本例:mydatasource1)
在JNDI名称中写入访问的名字(本例:test/ora9)
点击“继续”
在缓冲池名称中选择myconnection1
点击“继续”、“创建”
在列表中出现mydatasource1配置项
数据源配置完毕
4、测试JDBC数据源
创建并部署testjdbc.jsp,源码如下:
try{
Context initCtx=new InitialContext();
DataSource ds=(DataSource)initCtx.lookup("test/student");
Connection conn=ds.getConnection();
Statement stmt=conn.createStatement();
//查询表emp数据条数
ResultSet rs=stmt.executeQuery("select count(*) as num from emp");
rs.next();
out.println(rs.getString("num"));
rs.close();
stmt.close();
}catch(Exception e){
e.printStackTrace();
}
%>
将“test/student”换成自己的JNDI名称
将emp换成数据库中表
部署后运行

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











MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.
