当前位置:编程学习 > JAVA >>

Java(TM) Platform SE binary 一运行就停止了,是什么情况?求大神帮忙

--------------------编程问答-------------------- 重装下试试  --------------------编程问答-------------------- 命令行运行java有反应吗?

装的jdk版本是否和机器匹配? --------------------编程问答-------------------- jdk 和机器 都是64位的啊,而且运行 java 有反应,就是在myeclipse 运行程序 就出错了 --------------------编程问答-------------------- myeclipse里改为自己安装的jdk,别用自带的了。 --------------------编程问答-------------------- 就是用 自己装的,jdk1.7 以前还好,昨天就出现这个问题了,是不是与运行的程序有关啊? --------------------编程问答-------------------- 运行啥程序? --------------------编程问答-------------------- package com.insigma.luyongjie;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import com.insigma.pojo.Account;
import com.insigma.pojo.HibernateSessionFactory;
public class AccountDAO4Hibernate {
 public Account QueryAccountById(Integer id){
     Session  session = HibernateSessionFactory.getSession();
   Account account  = (Account)session.get(Account.class, id);
   HibernateSessionFactory.closeSession();
 return   account;
 }
 public Account QueryAccount(Integer id){
     Session  session = HibernateSessionFactory.getSession();
//      String  HQL="form Account where id:acid";
     String  HQL="form Account where id="+id;
     Query query = session.createQuery(HQL);
     query.setInteger("acid", id);
     Account account = (Account)query.uniqueResult();
   HibernateSessionFactory.closeSession();
 return   account;
 }
 public List<Account> QueryAllAccount(){
     Session  session = HibernateSessionFactory.getSession();
//      String  HQL="form Account where id:acid";
        String  HQL="form Account ";
       Query query = session.createQuery(HQL);
       List<Account>  list = query.list();
        HibernateSessionFactory.closeSession();
        return   list;
 }
public static void main(String[] args) {
//           Account account   =     new AccountDAO4Hibernate().QueryAccountById(2);
//           System.out.println(account.getName());
 List<Account>  list = new AccountDAO4Hibernate().QueryAllAccount();
for (Account account : list) {
System.out.println(account.getName());
}
                }
}
帮忙看看 是程序的什么问题吗?
补充:Java ,  Java相关
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,