摘要: jdbc连接数据库的步骤:1、加载jdbc驱动程序;2、创建数据库的连接;3、创建preparedStatement;4、执行SQL语句;5、遍历结果集;6、处理异常,关闭JDBC对象资源。 本文操作环境:windows10系统、java 1.8、thinkpad t480电脑。 JDBC连接数据库 阅读全文
posted @ 2022-09-04 22:00 蓬帅 阅读(642) 评论(0) 推荐(0) 编辑
摘要: Singleton_单例模式: 常规实现: public class Singleton{ private Singleton(){ } private final static Singleton INSTANCE=new Singleton(); public static Singleton 阅读全文
posted @ 2022-09-04 21:34 蓬帅 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 这里咪博士从网上搜集了一些 License server 地址(可能会被封,请自行斟酌使用) http://idea.iteblog.com/key.phphttp://intellij.mandroid.cnhttp://idea.imsxm.comhttp://shaofan.org:8080h 阅读全文
posted @ 2022-09-04 21:31 蓬帅 阅读(340) 评论(0) 推荐(0) 编辑
摘要: //加载properties文件 ResourceBundle rb=ResourceBundle .getBundle("properties文件名称"); String driver=rb.getString("properties文件中数据库驱动对应的key值"); String url=rb 阅读全文
posted @ 2022-09-04 21:29 蓬帅 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 获取bean对象代码: ApplicationContext app=new ClassPathXmlApplicationContext("applicationContext.xml"); app.getBean("userDao"); 通过配置文件里bean的id值获得bean对象 1:通过反 阅读全文
posted @ 2022-09-04 00:13 蓬帅 阅读(1212) 评论(0) 推荐(0) 编辑
摘要: 下面是一个应用FactoryBean的例子 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context=" 阅读全文
posted @ 2022-09-04 00:07 蓬帅 阅读(64) 评论(0) 推荐(0) 编辑
摘要: Spring 创建bean的几种方式 在XML配置文件中,通过bean标签创建bean,然后再通过spring容器进行管理 创建xml配置文件定义bean 一、通过构造函数创建 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http 阅读全文
posted @ 2022-09-03 23:48 蓬帅 阅读(308) 评论(0) 推荐(0) 编辑
摘要: <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.0.5.RELEASE</version> </dependen 阅读全文
posted @ 2022-09-03 22:56 蓬帅 阅读(22) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示