TA的每日心情 | 开心 2021-3-12 23:18 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
<%@ page language="java" import="java.sql.*" %>
<%
java.sql.Connection Conn;
java.sql.Statement Stmt;
java.sql.ResultSet Rst;
String con_string="jdbc:mysql://localhost:3306";
con_string=con_string+"/soft?user=javauser;password=javadude";
Class.forName("com.mysql.jdbc.Driver");
Conn = DriverManager.getConnection(con_string);
DatabaseMetaData dbmd=Conn.getMetaData();
ResultSet rs=dbmd.getTables(null,null,"%",null);
while(rs.next()){
out.print("table-name: "+rs.getString(3)+"<br>");
}
%>
上面jsp文件的输出结果:
table-name: admin
table-name: count_num
table-name: good
table-name: jivethreadaddon
table-name: soft
table-name: tuijian
table-name: type
table-name: type_parent |
|