标题:class.forName报错,请指教
取消只看楼主
buffon1005
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-3-21
 问题点数:0 回复次数:0 
class.forName报错,请指教
<%
        final String DBDRIVER = "com.mysql.jdbc.Driver" ;
        final String DBURL = "jdbc:mysql://localhost/training" ;
        final String DBUSER = "root" ;
        final String DBPASSWORD = "root" ;
        Connection conn = null ;
        System.out.println("DB link");
    %>
    <%
        try
        {
            Class.forName(DBDRIVER); ;
            conn = DriverManager.getConnection(DBURL,DBUSER,DBPASSWORD) ;
            String sql = "SELECT id,uid,name,password FROM person" ;
            PreparedStatement pstmt = null ;
            pstmt =conn.prepareStatement(sql);
            ResultSet rs = pstmt.executeQuery() ;
            System.out.println("DB query");
    %>

用的室MyEclipse,MySql驱动已添加
程序一执行到Class.forName(DBDRIVER); 就跳出,怎么回事啊
搜索更多相关主题的帖子: forName class String final 
2008-04-23 12:35



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-210623-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.104363 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved