diff --git a/.idea/misc.xml b/.idea/misc.xml index 11bca97..0548357 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/documents/选题1.2.docx b/documents/选题1.2.docx new file mode 100644 index 0000000..a1f0cc8 Binary files /dev/null and b/documents/选题1.2.docx differ diff --git a/src/gdms/test.java b/src/gdms/test.java deleted file mode 100644 index 615ee8d..0000000 --- a/src/gdms/test.java +++ /dev/null @@ -1,49 +0,0 @@ -package gdms; -import core.user.Student; -import core.user.User; -import dao.DBManagement; -import org.apache.tomcat.jdbc.pool.DataSource; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import java.lang.reflect.InvocationTargetException; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class test { - public test(){ - Connection con = null; - try{ - con = DBManagement.getConnection(); - Statement stmt = con.createStatement(); //创建Statement对象 - System.out.print("成功连接到数据库!"); - String sql = "select * from test"; - ResultSet rs = stmt.executeQuery(sql); - rs.next(); - System.out.println(rs.getString("name")); - rs.close(); - stmt.close(); - con.close(); - }catch (Exception e){ - e.printStackTrace(); - }finally { - if(con!=null) { - try { - con.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - } - } - - } - public static void main(String argc[]) throws NamingException, SQLException { - new test(); - } -}