您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

jdbc-安卓新手用JDBC连接mysql时一直报错

2025/3/8 14:42:52发布13次查看
mysqljdbc数据库android
抛出异常在logcat提示:驱动连接成功,数据库连接失败could not find class 'javax.naming.stringrefaddr', referenced from method com.mysql.jdbc.connectionpropertiesimpl$connectionproperty.storeto。求大神帮忙,错误围绕好长时间了
连接代码
//连接数据库 public static connection getcon() { connection conn = null; try { class.forname(org.gjt.mm.mysql.driver); system.out.println(驱动连接成功); } catch (classnotfoundexception e1) { // todo auto-generated catch block system.out.println(驱动连接失败); } string dburl = jdbc:mysql://localhost:3306/student; string username = root; string psw = 1234; try { conn = drivermanager.getconnection(dburl,username,psw); } catch (sqlexception e) { // todo auto-generated catch block system.out.println(数据库连接失败+e); } return conn; }
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product