摘要: 在使用PreparedStatement进行模糊查询的时候废了一番周折,以前一直都没有注意这个问题。一般情况下我们进行精确查询,sql语句类似:select * from table where name =?,然后调用PreparedStatement的setString等方法给?指定值。那么模糊 阅读全文
posted @ 2017-10-18 16:20 北方的老狼 阅读(162) 评论(0) 推荐(0)
摘要: EJB 阅读全文
posted @ 2017-10-16 15:00 北方的老狼 阅读(132) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { Connection conn=null; Statement stmt=null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); conn=Drive 阅读全文
posted @ 2017-10-16 14:42 北方的老狼 阅读(153) 评论(0) 推荐(0)
摘要: 数值:int,double 字符:varchar,char 时间:datetime 注释: 1.-- 2.# 3./*.....*/ 阅读全文
posted @ 2017-10-16 11:08 北方的老狼 阅读(180) 评论(0) 推荐(0)
摘要: 一、准备工作(以下为本实例使用工具) 1、MyEclipse10.7.1 2、JDK 1.6.0_22 二、创建服务端 1、创建【Web Service Project】,命名为【TheService】。 2、创建【Class】类,命名为【ServiceHello】,位于【com.hyan.serv 阅读全文
posted @ 2017-10-15 11:10 北方的老狼 阅读(256) 评论(0) 推荐(0)
摘要: 1.timestamp类型 create table manager( id int not null primary key, mdate timestamp not null default current_timestamp ); 2.datetime类型 create table manag 阅读全文
posted @ 2017-10-15 11:01 北方的老狼 阅读(16278) 评论(1) 推荐(0)
摘要: 一、不用where 1=1 在多条件查询中的困扰 举个例子,如果您做查询页面,并且,可查询的选项有多个,同时,还让用户自行选择并输入查询关键词,那么,按平时的查询语句的动态构造,代码大体如下: ①种假设 如果上述的两个IF判断语句,均为True,即用户都输入了查询词,那么,最终的MySqlStr动态 阅读全文
posted @ 2017-10-15 10:55 北方的老狼 阅读(2405) 评论(0) 推荐(1)
摘要: mysql中用于表示时间的三种类型date, datetime, timestamp (如果算上int的话,四种) 比较容易混淆,下面就比较一下这三种类型的异同 相同点 都可以用于表示时间都呈字符串显示 不同点 1.顾名思义,date只表示'YYYY-MM-DD'形式的日期,datetime表示'Y 阅读全文
posted @ 2017-10-15 10:52 北方的老狼 阅读(2042) 评论(0) 推荐(0)