用odbc连接sqlserver 2000 jsp语句中用户名密码怎么写?
展开全部
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.*" %>
<HTML>
<BODY>
<% Connection con;
Statement sql;
ResultSet rs;
try{Class.forName("jsj.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e){}
try { con=DriverManager.getConnection("jdbc:odbc:jsj","用户名","密码");
sql=con.createStatement();
rs=sql.executeQuery("SELECT * FROM students");
con.close();
}
catch(SQLException e1) {}
%>
</BODY>
</HTML
<%@ page import="java.sql.*" %>
<HTML>
<BODY>
<% Connection con;
Statement sql;
ResultSet rs;
try{Class.forName("jsj.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e){}
try { con=DriverManager.getConnection("jdbc:odbc:jsj","用户名","密码");
sql=con.createStatement();
rs=sql.executeQuery("SELECT * FROM students");
con.close();
}
catch(SQLException e1) {}
%>
</BODY>
</HTML
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询