`
lanhuidong
  • 浏览: 227692 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论
文章列表
1.从apache下载Cassadra http://cassandra.apache.org/download/ 2.解压到指定目录下(注意:解压路径不要带空格,否则启动时会报异常),如:D:\cassadra 3.进入conf目录,(红色字体为自己指定的目录)    打开cassandra.yaml:D:\cassadra\apache-cassandra-0.7.0\conf\cassandra.yaml    data_file_directories:    - D:/cassandra/data       commitlog_directory: D:/cassandr ...
1.先定义两个model:Question和Answer,每个Question对应多个Answer; Question.java package lan.study.hibernate.model; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.O ...
test.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/ht ...
SELECT * FROM (SELECT * FROM result r WHERE r.activity_id = 2 ORDER BY r.score DESC,r.elapsed_time,r.play_time) t GROUP BY t.player ORDER BY t.score DESC,t.elapsed_time,t.play_time;  
MySQL Version:5.1.49-communtity 1.       检查MySQL服务器是否支持表分区 mysql>show variables like ‘%partition%’;         2.       创建表   CREATE TABLE USER ( id INT AUTO_INCREMENT, username VARCHAR(20), birthday DATETIME, PRIMARY KEY ( ...
1.Master配置 打开MySQL配置文件, [mysqld] log-bin=mysql-bin //启用二进制日志文件,MySQL的服务器之间数据配置依赖此文件 server-id=1 //如果为0,则会拒绝Slave的连接 innodb_flush_log_at_trx_commit=1 sync_binlog=1 //以上两行是为了保证数据的一致性和持久性 #skip-networking //如果启用,这Master和Slave之间不能通信   2.Slave配置
最近项目要求某些表记录数据的插入时间和更新时间: import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; @Entity public class Wangwang { private Integer id; private ...
创建表catagory CREATE TABLE `catagory` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `create_time` datetime DEFAULT NULL, `update_time` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8   创建触发器create_time用于记录用户往 ...
1.OneToOne共享主键 import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToOne; import javax.persistence.PrimaryKeyJoinColumn; /** * @author lan 2010-8-26 * 主表 */ @Entity pu ...
今天看了下Hibernate的@Column注解 @Column(    name="columnName";                         1    boolean unique() default false;              2    boolean nullable() default true;              3    boolean insertable() default true;           4    boolean updatable() default true;           5    Strin ...
   Eclipse is running in a JRE, but a JDK is required   Some Maven plugins may not work when importing projects or updating source folders.   解决办法:    

Integer之==

    博客分类:
  • Java
package lan; public class Test { public static void main(String[] args) { Integer i1 = 4; Integer i2 = 4; System.out.println(i1 == i2); } } 当i1、i2的值在-128~127之间时,输出true,否则为false。 java language specification-3.0 写道 If p is a value of type ...
Global site tag (gtag.js) - Google Analytics