`
远方的彪
  • 浏览: 8955 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论
文章列表
使用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 ...
public static void putAllIdToMap(String json, String name, String id) { String value = ""; String key = ""; Map<String, Object> map = (Map<String, Object>)JsonUtils.jsonToMap(json); for (Entry<String, Object> key1 : map.entrySet()) { JsonPars ...
  hibernate 处理事务: 1、继承:org.springframework.orm.hibernate3.support.HibernateDaoSupport public void deleteOper(final String sql, List<Component> lists) { Session session = getSessionFactory().openSession(); Transaction tx = session.beginTransaction(); //执行第一个删除 //执行第 ...
// 获取ip地址 public static String getIpAddress() { try { Enumeration<NetworkInterface> allNetInterfaces = NetworkInterface.getNetworkInterfaces(); InetAddress ip = null; while (allNetInterfaces.hasMoreElements()) { NetworkInterface netInterface = (NetworkInterface)allNetInt ...
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 ...
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()为获取当前系统时间 } }
Hibernate自动创建表 : 只要在hibernate.cfg.xml添加这句话,就可以自动生成数据表 <property name="hibernate.hbm2ddl.auto">update</property> update:表示自动根据model对象来更新表结构,启动hibernate时会自动检查数据库,如果缺少表,则自动建表;如果表里缺少列,则自动添加列。 还有其他的参数: create:启动hibernate时,自动删除原来的表,新建所有的表,所以每次启动后的以前数据都会丢失。 create-drop:启动hibern ...

程序部署

1、把程序打包成war文件 2、把war文件放到服务器的tomcat下
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 { / ...
开发环境:Eclipse 1、建立表guestbook 2、新建一个java项目first 3、导入jar包 4、编写Hibernate 的配置文件hibernate.cfg.xml 5、编写GuestBook.java 6、编写类和表之间的映射文件Guestbook.hbm.xml 7、编写一个测试文件HibernateTest.java
计算机网络常见端口: 端口:21 服务:ftp 说明:ftp服务器所开放的端口,用于上传、下载。最常见的攻击者用于寻找打开anonymous的ftp服务器的方法。这些服务器带有可读写的目录。木马doly trojan、fore、invisible ftp、webex、wincrash ...
hibernate自动注解创建表 1、编写实体类, 2、编写配置文件hibernate.cfg.xml:     其中注意的地方有:<property name="hibernate.hbm2ddl.auto">create</property> 不要写成update     <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> 不要写成MySQLInnoDBDialect 3、编写测试类,
Global site tag (gtag.js) - Google Analytics