JSP连接一个MYSQL数据库具体需要什么步骤? http://210.35.0.36/nt/ntsky/news/listarticle.jsp?articleid=4连接数据库的类,用jdbc驱动要加载jdbc的驱动程序。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 还有一点要说明一下,就是我的JDBC也已经安装了,刚才看到好象还要设置JDBC的路径方面什么的,我确实不懂,希望可以明示! 点一下右上角的FAQ,去csdn首页的文档搜索到google查找都有很多答案阿 你需要一个mysql jdbc的工具包类似于:mysql-connector-java-3.0.7-stable-bin.jar然后:class SqlCon{ private Connection myconn ; private Connection remoteconn ; private PreparedStatement pstmt; private Statement st; private Statement stmt; private ResultSet rs; private ResultSet res; public SqlCon() { try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); String url1 ="jdbc:mysql://192.168.77.3/suhang?user=root&password=zeebo&useUnicode=true&characterEncoding=gb2312&autoReconnect=true"; String url2 ="jdbc:mysql://192.168.77.4/info?user=root&password=zeebo&useUnicode=true&characterEncoding=gb2312&autoReconnect=true"; myconn= DriverManager.getConnection(url1); remoteconn= DriverManager.getConnection(url2); } catch(Exception e) { System.out.println("Cannot get the client stream"+e); } }//其他函数和语句。} 请教:在jsf中如何获得分页后记录的行序号? 用des加密算法 加密字符串 怎么老出这个错误? 刚学jsp 求个简单的插件能实现上传图片 没接触不知道该从什么地方下手!!! 求帮忙做个数据库 100分求解 为什么只是显示数据库中的第一条记录啊?? 运行jsp程序需要安装什么组件(我的电脑装的是windows 2000)? 请有struts经验的高手们指教一个问题 TOMCAT里面,jsp文件应该放在那个目录里面? 请问哪有weblogic5.1可以下?? 有没有人能帮忙改写一段JAVA代码为PHP 网页上怎么实现自定义热键 提交表单不能取参数的典型例子
到google查找都有很多答案阿
class SqlCon
{
private Connection myconn ;
private Connection remoteconn ;
private PreparedStatement pstmt;
private Statement st;
private Statement stmt;
private ResultSet rs;
private ResultSet res;
public SqlCon()
{
try
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String url1 ="jdbc:mysql://192.168.77.3/suhang?user=root&password=zeebo&useUnicode=true&characterEncoding=gb2312&autoReconnect=true";
String url2 ="jdbc:mysql://192.168.77.4/info?user=root&password=zeebo&useUnicode=true&characterEncoding=gb2312&autoReconnect=true";
myconn= DriverManager.getConnection(url1);
remoteconn= DriverManager.getConnection(url2);
}
catch(Exception e)
{
System.out.println("Cannot get the client stream"+e); } }//其他函数和语句。
}