想保持一个数据库连接的说..启动mckoi数据库后,用squirrel连不上了
外面执行打包好的jar不行啊
eclipse中执行主文件就可以保持着...
new StartMckoi().run();
Thread thread = new Thread("abc");
thread.start();
...线程知识还是薄弱啊..求助

解决方案 »

  1.   

        为什么我启动线程马上就退出了  ?
        只用你run()里不是死循环肯定要退出啊
      

  2.   

    new StartMckoi().run(); 
    Thread thread = new Thread("abc"); 
    thread.start(); 
    这样写是不对的
     可以这样写
    public class a extends thread{
        public void run()
        {
           这里写你要运行的代码
         }
       public static void main(String arg)
       {
             a tmp=new a();
              a.start();
       }
    }