第一步:在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的更多相关文章

  1. spring学习之三 数据库操作jdbcTemplate

    概念 jdbcTemplate就Spring对数据库持久化技术的实现,通过它可以对数据库进行CRUD等操作. JDBCTemplate和代码实现 public void jdbcadd() { Dri ...

  2. JdbcTemplate实现CRUD操作

    ------------------siwuxie095                                     JdbcTemplate 实现 CRUD 操作         1.J ...

  3. spring jdbcTemplate的CRUD操作

    一.jdbcTemplate准备 1.导入与jdbcTemplate相关的jar包 2.设置数据库信息 3.创建jdbcTemplate对象,设置数据源 二.添加操作 1.代码 2.结果 三.修改操作 ...

  4. Spring中的JdbcTemplate使用

    1.引出SpringJDBC的概念 在学习JDBC编程时我们会感觉到JDBC的操作是多么繁琐,那么当我们学习的Hibernate框架时,我们感觉到数据库的操作也变非常简单,提高了开发效率.但是当使用H ...

  5. Spring 对JDBC操作的支持

    1.Spring 对JDBC操作的支持 Spring对jdbc技术提供了很好的支持,体现在: 1.Spring对c3p0连接池的支持很完善 2.Spring对jdbc提供了jdbcTemplate,来 ...

  6. SSM框架之Spring(5)JdbcTemplate及spring事务控制

    Spring(5)JdbcTemplate及spring事务控制 ##1.JdbcTmeplate 它是 spring 框架中提供的一个对象,是对原始 Jdbc API 对象的简单封装.spring ...

  7. 12 Spring JdbcTemplate的使用

    1.项目搭建 <1>数据库表account对应的账户实体类 package domain; import java.io.Serializable; /** * 账户实体类 */ publ ...

  8. 【Spring】Spring的数据库开发 - 2、Spring JdbcTemplate的常用方法(execute、update、query)

    Spring JdbcTemplate的常用方法 文章目录 Spring JdbcTemplate的常用方法 execute() update() query() 简单记录-Java EE企业级应用开 ...

  9. 架构实例之SpringTest

    架构实例之SpringTest 1.开发工具和开发环境       开发工具: MyEclipse10,JDK1.6.0_13(32位),Tomcat7.0(32位),mysql5.7.13 开发环境 ...

随机推荐

  1. MySql 学习笔记 (派生表)

    派生表也是一种子查询那么它出现在 select * from ( select * from b <--这个就是派生表啦 )派生表其实不是个好东西,在生产的时候他是可以通过索引来过滤的,但是一但 ...

  2. cf B. Fence

    http://codeforces.com/contest/363/problem/B #include <cstdio> #include <cstring> #includ ...

  3. 局域网架个YUM源-HTTP的

    在安装CDH时,这是个绕不过去的坎. 参考URL: http://www.21ops.com/linux/26465.html 奇怪的是,我并没执行creatrepo这个,直接将光盘MOUNT来用的. ...

  4. SVN莫名出错,网上找遍无果,递归删除当前目录下所有.svn文件名

    哎,太深刻的教训. 原来以前其它目录里有.SVN目录 ,而此SVN目录COPY到真正的SVN工作目录之后,会将有用的.SVN目录覆盖. 那么一样,显然,CI,UPDATE,CO之间的命令全部异常... ...

  5. ASP.NET中默认的一级目录

    默认一级目录结构: /Controllers – 存放负责处理 存放负责处理 URL请求的控制器类: 类:/Models – 存放表示和操纵数据以及业务对象的类: /Views – 存放负责呈现输出内 ...

  6. GNU Autotools的研究(转)

    最近对Linux下软件项目的构建过程研究了一番.Linux下的软件项目通常用Autotools工具集和make工具来构建,我们通常使用./configure.make.make install这样的命 ...

  7. linux磁盘限额配置:quota命令

    LINUX下也有类似WINDOWS NTFS所用的磁盘限额,用的是quota来实现通过rpm -q quota确定是否已安装用quota只能对patation做限额,要做到针对某个目录来做只能靠ln ...

  8. 1645: [Usaco2007 Open]City Horizon 城市地平线

    1645: [Usaco2007 Open]City Horizon 城市地平线 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 315  Solved: ...

  9. (greedy)Best Time to Buy and Sell Stock II

    Say you have an array for which the ith element is the price of a given stock on day i. Design an al ...

  10. 简单拨号器(Android)

    感受: 1.了解了intent中的action和Uri. 2.了解了向下一个活动传递数据. 3.了解了内容提供器. 4.了解自定义适配器. 4.其实T9拨号器和简单计算器原理一样.