reza71
reza71

Reputation: 37

Netbeans doesn't recognize import com.mysql.jdbc.jdbc2.optional.MysqlDataSource?

i am trying to access database with DataSource , for configuring datasource i need to import com.mysql.jdbc.jdbc2.optional.MysqlDataSource but the problem is that Netbeans doesn't recognize it , saying that package doesn't exist.

(i installed java jdk v.8 , and i am using Netbeans IDE v8.0.2)

Upvotes: 4

Views: 4730

Answers (1)

rhitz
rhitz

Reputation: 1892

Download MySql JDBC Jar file from here and follow the steps below.

Here are screenshots for you.

  • Add the JAR file in your Project by Right Click on your Project's Library folder

enter image description here

  • Add Jar/Folder, Browse the Jar file and add it.

enter image description here

  • Import com.mysql.jdbc.jdbc2.optional.MysqlDataSource . Done.

enter image description here

Hope it helps.

Upvotes: 6

Related Questions