Class.forName("com.mysql.jdbc.Driver")加载驱动失败,请高手指点下什么原因
android工程通过jdbc调用mysql驱动报错:Class.forName("com.mysql.jdbc.Driver")10-1213:49:06.347:E/...
android工程通过jdbc调用mysql驱动报错:Class.forName("com.mysql.jdbc.Driver")
10-12 13:49:06.347: E/dalvikvm(10506): Could not find class 'com.mysql.jdbc.Connection', referenced from method com.androidmysqltest.AndroidMysqlTest.onCreate 10-12 13:49:06.347: W/dalvikvm(10506): VFY: unable to resolve check-cast 19 (Lcom/mysql/jdbc/Connection;) in Lcom/androidmysqltest/AndroidMysqlTest; 10-12 13:49:06.347: D/dalvikvm(10506): VFY: replacing opcode 0x1f at 0x003d 10-12 13:49:06.347: D/dalvikvm(10506): VFY: dead code 0x003f-0047 in Lcom/androidmysqltest/AndroidMysqlTest;.onCreate (Landroid/os/Bundle;)V 10-12 13:49:06.402: I/System.out(10506): Error loading Mysql Driver! 展开
10-12 13:49:06.347: E/dalvikvm(10506): Could not find class 'com.mysql.jdbc.Connection', referenced from method com.androidmysqltest.AndroidMysqlTest.onCreate 10-12 13:49:06.347: W/dalvikvm(10506): VFY: unable to resolve check-cast 19 (Lcom/mysql/jdbc/Connection;) in Lcom/androidmysqltest/AndroidMysqlTest; 10-12 13:49:06.347: D/dalvikvm(10506): VFY: replacing opcode 0x1f at 0x003d 10-12 13:49:06.347: D/dalvikvm(10506): VFY: dead code 0x003f-0047 in Lcom/androidmysqltest/AndroidMysqlTest;.onCreate (Landroid/os/Bundle;)V 10-12 13:49:06.402: I/System.out(10506): Error loading Mysql Driver! 展开
若以下回答无法解决问题,邀请你更新回答
展开全部
初步判断没有导入数据库需要的jar包
追问
解决了,确实是这个问题,但是现在又出现新的问题
10-14 09:35:31.421: E/dalvikvm(21967): Could not find class 'javax.naming.StringRefAddr'
追答
javax.naming.StringRefAddr这个类找不到,看看是不是没有导包或者类名写错了
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询