📄 conntest20.java
字号:
//Open the connection and then call isClosed(). It should return false.
//Close the connection and then call isClosed(). It should return true.
//Author: XieLiang
import java.sql.*;
public class ConnTest20
{
public static void main(String[] args)
{
try
{
Class.forName("csql.jdbc.JdbcSqlDriver");
Connection con = DriverManager.getConnection("jdbc:csql", "root", "manager");
if ( con == null )
System.exit(1);
if(con.isClosed()) System.exit(1);
con.close();
if(!con.isClosed()) System.exit(1);
}catch(Exception e) {
System.out.println(e.getMessage());
e.getStackTrace();
System.exit(1);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -