文章列表
- 博客分类:
使用swing 增加文件选择框:
private component getfilebutton() {
if (filebutton == null) {
filebutton = new jbutton("......");
filebutton.setbounds(445, 135, 54, 23);
filebutton.addactionlistener(new actionlistener() {
public void actionperformed(actionevent e) {
jfile ...
- 2017-02-08 16:49
- 浏览 1348
- 分类:编程语言
public static void putallidtomap(string json, string name, string id) {
string value = "";
string key = "";
map map = (map)jsonutils.jsontomap(json);
for (entry key1 : map.entryset()) {
jsonpars ...
- 2017-02-07 16:04
- 浏览 2080
- 分类:编程语言
- 博客分类:
hibernate 处理事务:
1、继承:org.springframework.orm.hibernate3.support.hibernatedaosupport
public void deleteoper(final string sql, list lists) {
session session = getsessionfactory().opensession();
transaction tx = session.begintransaction();
//执行第一个删除
//执行第 ...
- 2016-12-29 18:34
- 浏览 328
- 分类:编程语言
- 博客分类:
// 获取ip地址
public static string getipaddress() {
try {
enumeration allnetinterfaces = networkinterface.getnetworkinterfaces();
inetaddress ip = null;
while (allnetinterfaces.hasmoreelements()) {
networkinterface netinterface = (networkinterface)allnetint ...
- 2016-12-29 11:06
- 浏览 456
- 分类:编程语言
- 博客分类:
package file;
import java.io.bufferedreader;
import java.io.file;
import java.io.fileinputstream;
import java.io.filenotfoundexception;
import java.io.filewriter;
import java.io.ioexception;
import java.io.inputstreamreader;
import java.io.randomaccessfile;
import java.io.unsupportedencod ...
- 2016-01-07 10:33
- 浏览 570
- 分类:编程语言
- 博客分类:
import java.util.date;
import java.text.simpledateformat;
public class nowstring {
public static void main(string[] args) {
simpledateformat df = new simpledateformat("yyyy-mm-dd hh:mm:ss");//设置日期格式
system.out.println(df.format(new date()));// new date()为获取当前系统时间
}
}
- 2016-01-07 09:51
- 浏览 523
- 分类:编程语言
- 博客分类:
hibernate自动创建表 :
只要在hibernate.cfg.xml添加这句话,就可以自动生成数据表
update
update:表示自动根据model对象来更新表结构,启动hibernate时会自动检查数据库,如果缺少表,则自动建表;如果表里缺少列,则自动添加列。
还有其他的参数:
create:启动hibernate时,自动删除原来的表,新建所有的表,所以每次启动后的以前数据都会丢失。
create-drop:启动hibern ...
- 2015-04-15 10:44
- 浏览 559
- 博客分类:
java 连接mysql
//驱动程序名
string driver = "com.mysql.jdbc.driver";
// url指向要访问的数据库名student
string url = "jdbc:mysql://127.0.0.1:3306/student";
// mysql配置时的用户名
string user = "root";
// java连接mysql配置时的密码
string password = "root";
try {
/ ...
- 2014-11-09 13:54
- 浏览 462
- 分类:数据库
- 博客分类:
开发环境:eclipse
1、建立表guestbook
2、新建一个java项目first
3、导入jar包
4、编写hibernate 的配置文件hibernate.cfg.xml
5、编写guestbook.java
6、编写类和表之间的映射文件guestbook.hbm.xml
7、编写一个测试文件hibernatetest.java
- 2014-11-09 13:46
- 浏览 493
- 分类:编程语言
- 博客分类:
计算机网络常见端口:
端口:21
服务:ftp
说明:ftp服务器所开放的端口,用于上传、下载。最常见的攻击者用于寻找打开anonymous的ftp服务器的方法。这些服务器带有可读写的目录。木马doly trojan、fore、invisible ftp、webex、wincrash ...
- 2014-10-17 10:48
- 浏览 1127
- 分类:互联网