• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in type 4 driver

 
Punit Jain
Ranch Hand
Posts: 1028
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
Posts: 20831
68
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: 1028
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah , i m using IDE..
thanks...
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!