• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in type 4 driver

 
Punit Jain
Ranch Hand
Posts: 1014
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m getting an error in this code..



error is in these two line:



and error is:


Type mismatch: cannot convert from java.sql.Statement to com.mysql.jdbc.Statement


although i have added mysqlConnector to my jar files, but still i m getting the same error..???
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should never import any driver specific classes, but instead program against the JSE interfaces. You've probably used an IDE to resolve the import and chose the wrong one. So instead of importing com.mysql.jdbc.Statement, import java.sql.Statement.
 
Punit Jain
Ranch Hand
Posts: 1014
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah , i m using IDE..
thanks...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic