- 浏览: 50672 次
最新评论
文章列表
Database 使用 Mysql ,
建立User 表
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`firstName` varchar(20) DEFAULT NULL,
`lastName` varchar(20) DEFAULT NULL,
`age` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) 所需jar包
<?xml version="1.0" encoding="UTF-8"?>
<classpat ...
- 2013-01-13 20:51
- 浏览 666
- 评论(0)
建表sql
create table customers(
id bigint primary key,
name varchar(20) not null,
pass varchar(20) not null,
email varchar(128) not null,
image mediumblob,
birthday date,
registered_time timestamp
);Customer
package org.zbq.bean;
import java.sql.Date;
import java.sql.Timestamp;
public cl ...
- 2013-01-12 22:36
- 浏览 391
- 评论(0)
Service
package org.zbq.authority;
public interface Service {
public void view();
public void modify();
}ServiceImpl
package org.zbq.authority;
public class ServiceImpl implements Service {
@Override
public void view() {
System.out.println("用户查看数据");
}
@Override
public void ...
- 2013-01-05 22:36
- 浏览 434
- 评论(0)
Person
package org.zbq.aop;
public interface Person {
public void run();
public void info();
}
PersonImpl
package org.zbq.aop;
public class PersonImpl implements Person {
private int age;
private String name;
public int getAge() {
return age;
}
public void setAge(int age) {
...
- 2013-01-02 23:48
- 浏览 385
- 评论(0)
User
package org.zbq.bean;
public class User {
private String name;
private String pass;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
} ...
- 2013-01-02 22:24
- 浏览 279
- 评论(0)
Axe 接口
package org.zbq.spring;
public interface Axe {
public String chop();
}
Axe实现类 SteelAxe
package org.zbq.spring;
public class SteelAxe implements Axe {
@Override
public String chop() {
return "钢斧砍柴很快";
}
}
Axe实现类StoneAxe
package org.zbq.spring;
public class StoneAxe i ...
- 2013-01-01 22:40
- 浏览 379
- 评论(0)
Person 接口
package org.zbq.ioc;
public interface Person {
public void work();
}
Tool 接口
package org.zbq.ioc;
public interface Tool {
public void realWork();
}
Tool 实现类ConcreteToolA
package org.zbq.ioc;
public class ConcreteToolA implements Tool {
@Override
public void realWork ...
- 2013-01-01 01:45
- 浏览 459
- 评论(0)
1.U盘4GB以上容量(要装得下操作系统安装文件)
2.Diskpart命令行工具
具体操作如下:
C:\>diskpart
DISKPART> list disk
如果你的机器只有一块硬盘,那么U盘应该显示为Disk 1
DISKPART> select disk 1
选择U盘为当前磁盘
DISKPART> clean
清空磁盘
DISKPART> create partition primary
创建主分区
DISKPART> select partition 1
选择分 ...
- 2012-12-10 13:25
- 浏览 511
- 评论(0)
Hanoi塔问题,这是一个古典的数学问题,是一个只有用递归方法解决的问题。问题是这样的:古代有一个梵塔,塔内有3个座A,B,C,开始时A座上有64个盘子,盘子大小不等,大的在下,小的在上。有一个老和尚想把这64个盘子从A座移到C座,但每次只允许移动一个盘,且在移动过程中在3个座上都始终保持大盘在上,小盘在下。在移动过程中可以利用B座
#include <stdio.h>
void move(char x, char y){
static int i = 0;
printf("%3d: %c --> %c\n",++i, x, y);
}
void ...
- 2012-12-01 19:32
- 浏览 604
- 评论(0)
新建工程Ant Demo 建立一个src文件夹 和build.xml 文件
src中建立Hello.java文件
package org.zbq.ant;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.util.Date;
public class Hello extends JFrame{
private JFrame frame;
private JButton but;
public Hello(){
this.frame = new JFrame(&quo ...
- 2012-11-19 12:49
- 浏览 359
- 评论(0)
Calculator.java
package org.zbq.test;
public class Calculator {
public int add(int a, int b){
return a + b;
}
public int subtract(int a, int b){
return a - b;
}
public int multiply(int a, int b){
return a * b;
}
public int division(int a, int b) throws Exception {
if(0 == b){ ...
- 2012-11-13 23:10
- 浏览 396
- 评论(0)
path路径下导入Hibernate/lib/required目录下所有的jar包。以及连接数据库的Jar包
层次结构
hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate. ...
- 2012-11-08 10:54
- 浏览 608
- 评论(0)
由MyEclipse下导入的Hibernate的jar包
Struts2基本jar包和MySql驱动jar包
源代码文件
数据库脚本
create database hibernate;
use hibernate;
create table if not exists user (
id int primary key,
name varchar(20),
pass varchar(20)
};
web.xml 配置文件
<?xml version="1.0" encoding=" ...
- 2012-10-22 22:08
- 浏览 292
- 评论(0)
Component
public interface Component {
public void doSomething();
}
ConcreteComponent
public class ConcreteComponent implements Component {
@Override
public void doSomething() {
System.out.println("Function ");
}
}Decorator
public class Decorator implements Component {
...
- 2012-09-15 15:32
- 浏览 372
- 评论(0)
接口
interface Subject{
public String say(String name,int age) ; // 定义抽象方法say
}
真实主题类
class RealSubject implements Subject{ // 实现接口
public String say(String name,int age){
return "姓名:" + name + ",年龄:" + age ;
}
}
代理类
class MyInvocationHandler implements Invoc ...
- 2012-08-27 22:43
- 浏览 623
- 评论(0)