Netbeans7.4+Weblogic11g+Spring3.2.4操作JdbcTemplate
第一步:在Weblgic11g管理界面:http://localhost:7001/console 中建立数据源,我建立的jndi名称为:sjsstjndi
第二步:需要导入spring的以下包:使用JdbcTemplate 一定要导入spring-jdbc/tx..这两个包。

第三步:applicationContext.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <!-- 数据源配置,使用Weblogic应用服务器的数据库连接池 -->
<jee:jndi-lookup id="wst" jndi-name="sjsstjndi"/> <bean id="jdbcTmpl" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource">
<ref bean="wst" />
</property>
</bean> </beans>
Netbeans7.4+Weblogic11g+Spring3.2.4操作JdbcTemplate的更多相关文章
- spring学习之三 数据库操作jdbcTemplate
概念 jdbcTemplate就Spring对数据库持久化技术的实现,通过它可以对数据库进行CRUD等操作. JDBCTemplate和代码实现 public void jdbcadd() { Dri ...
- JdbcTemplate实现CRUD操作
------------------siwuxie095 JdbcTemplate 实现 CRUD 操作 1.J ...
- spring jdbcTemplate的CRUD操作
一.jdbcTemplate准备 1.导入与jdbcTemplate相关的jar包 2.设置数据库信息 3.创建jdbcTemplate对象,设置数据源 二.添加操作 1.代码 2.结果 三.修改操作 ...
- Spring中的JdbcTemplate使用
1.引出SpringJDBC的概念 在学习JDBC编程时我们会感觉到JDBC的操作是多么繁琐,那么当我们学习的Hibernate框架时,我们感觉到数据库的操作也变非常简单,提高了开发效率.但是当使用H ...
- Spring 对JDBC操作的支持
1.Spring 对JDBC操作的支持 Spring对jdbc技术提供了很好的支持,体现在: 1.Spring对c3p0连接池的支持很完善 2.Spring对jdbc提供了jdbcTemplate,来 ...
- SSM框架之Spring(5)JdbcTemplate及spring事务控制
Spring(5)JdbcTemplate及spring事务控制 ##1.JdbcTmeplate 它是 spring 框架中提供的一个对象,是对原始 Jdbc API 对象的简单封装.spring ...
- 12 Spring JdbcTemplate的使用
1.项目搭建 <1>数据库表account对应的账户实体类 package domain; import java.io.Serializable; /** * 账户实体类 */ publ ...
- 【Spring】Spring的数据库开发 - 2、Spring JdbcTemplate的常用方法(execute、update、query)
Spring JdbcTemplate的常用方法 文章目录 Spring JdbcTemplate的常用方法 execute() update() query() 简单记录-Java EE企业级应用开 ...
- 架构实例之SpringTest
架构实例之SpringTest 1.开发工具和开发环境 开发工具: MyEclipse10,JDK1.6.0_13(32位),Tomcat7.0(32位),mysql5.7.13 开发环境 ...
随机推荐
- 【Xamarin-IOS 开发环境搭建】
MAC 比较贵,虚拟机的干活..... 配置完虚拟机.进去后 ,安装XCode的 时候 ,失败了.错误信息: But when i have tried to install the Xcode it ...
- vs2010 suite integration toolkit execution
原因是UltraDeamen的问题,重新换个WinMount来解压ISO文件.完美安装运行
- 【转】Win7+Ubuntu12.04.1硬盘安装错误及解决方案----不错
原文网址:http://blog.csdn.net/ys_073/article/details/8310115 前言: 说起来了,为了在Win7上进行硬盘安装Ubuntu浪费了整整一个晚上的时间.装 ...
- Android单元测试: 首先,从是什么开始
Android单元测试: 首先,从是什么开始 http://chriszou.com/2016/04/13/android-unit-testing-start-from-what.html 这是一系 ...
- 又一编辑神器-百度编辑器-Ueditor
(Lionden<hsdlionden@gmail.com> 转载说明) 前段时间发表过一篇关于“KindEditor在JSP中使用”的博文.这几天在沈阳东软进行JavaWeb方面的实习工 ...
- java之File
1.文件创建.重命名.删除 code: package com.test; import java.io.File; import java.io.IOException; public class ...
- python高级编程:有用的设计模式1
# -*- coding: utf-8 -*-__author__ = 'Administrator'#python高级编程:有用的设计模式#设计械是可复用的,某种程序上它对软件设计中觉问题提供的语言 ...
- js将日期格式的时候转换成时间搓
自己写的一个方法 function split_time(time){//将当前时间转换成时间搓 例如2013-09-11 12:12:12 var arr=time.split(" ...
- LRU Cache的简单c++实现
什么是 LRU LRU Cache是一个Cache的置换算法,含义是“最近最少使用”,把满足“最近最少使用”的数据从Cache中剔除出去,并且保证Cache中第一个数据是最近刚刚访问的,因为这样的数据 ...
- [RxJS] Logging a Stream with do()
To help understand your stream, you’ll almost always want to log out some the intermediate values to ...