如果不释放,那平白无故多也许多代码。

解决方案 »

  1.   

    进程终止严格上说不会释放,只不过数据库端有time out机置,自动在指定时间内会回收不用connection
      

  2.   

    一般的数据库都会有检查机置,但是做为一个良好的飞惯您还是在system.exit(0);之前调用数据库的关闭操作,以便database client api及时的通知服务端关闭无用的connection
      

  3.   

    System.exit(0)就是直接终止当前运行的JVM  
      

  4.   

    應該會去掉
    System.exi(0)很霸道、、
      

  5.   

    建议采用正常的方法关闭数据库连接对象,不要采用这种方法,而且也不建议在代码中使用 System.exit!
      

  6.   

    Terminates the currently running Java Virtual Machine. The argument serves as a status code; by convention, a nonzero status code indicates abnormal termination. 
    This method calls the exit method in class Runtime. This method never returns normally. The call System.exit(n) is effectively equivalent to the call:  Runtime.getRuntime().exit(n)
    api上这么解释