📄 databaseconnecttest.java
字号:
import java.sql.*;public class DatabaseConnectTest{ public static void main(String[] args) { // Get an instance of a Connection from the DatabaseManager // who is performing Creator pattern here by creating instances of // a class that implements the Connection interface. Connection conn = DatabaseManager.getConnection(); if ( conn != null ) { System.out.println( "Connection attempt was successful!" ); try { conn.close(); } catch( SQLException ex ) { ex.printStackTrace(); System.out.println( "Problem closing the connection" ); } } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -