Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8946595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:33:39+00:00 2026-06-15T12:33:39+00:00

I have Xampp installed on my pc with mysql database. now i wish to

  • 0

I have Xampp installed on my pc with mysql database. now i wish to use this mysql database for my java JDBC program. For that i have writen following program.

package mysqltype4driverdemo;

import java.sql.*;
import java.util.*;


public class MysqlType4DriverDemo {

    public static void main(String[] args)throws SQLException {
        String url="jdbc:mysql://localhost:3306/mysql";
        Properties prop=new Properties();
        prop.setProperty("user","root");
        prop.setProperty("password","");
        Driver d=new com.mysql.jdbc.Driver();
        Connection con = d.connect(url,prop);
        if(con==null)   {
            System.out.println("connection failed");
            return;
        }
        DatabaseMetaData dm =con.getMetaData();
        String dbversion=dm.getDatabaseProductVersion();
        String dbname=dm.getDatabaseProductName();
        System.out.println("name:"+dbname);
        System.out.println("version:"+dbversion);

    }
}

but it says “package com.mysql.jdbc” does not exists.
P.S. : i am using netbeans 7.2.x IDE on windows XP platform

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:33:41+00:00Added an answer on June 15, 2026 at 12:33 pm

    It appears that you might have tried putting the library on the global CLASSPATH. For Netbeans projects, that’s not quite right. You need to add the appropriate library(ies) to the project using Netbeans’s library facility.

    1. Right-click on the project’s root node in the Projects tab.
    2. In the pop-up context menu, click on Properties (on the bottom of the menu).
    3. Click on Libraries under Categories:. You should see the following screen:
      Netbeans Project Properties Dialog: Libraries
    4. Click on the Add Library… button.
    5. Under Global Libraries click on MySQL JDBC Driver and then click the Add Library button.
    6. Click on OK.

    You should be good to go.

    If you need a specific version of the driver, you can download it, and then after clicking on Add Library… you can click on Create… to add the downloaded version to your library repository. You’d then remove the default JDBC Driver from the project, and add the library containing the specific version.

    I tried this out myself using your code and a newly-created project. No additional imports needed, and the default driver included with the Netbeans distro should be good enough unless you need a specific version for your project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, so I've installed xampp 1.7.7 and have my mysql database set up and
I have installed xampp on Windows7(64bit).I want to work with PHP, Apache and MySql.
I recently installed xampp, followed the installation. MySQL/apache. (I have same website running on
I have installed xampp 1.7.3. After starting apache and mysql service when I write
I have installed xampp . When i open xampp control panel, mysql and filezilla
I installed XAMPP to run PHP from eclipse. I have a standalone MySQL server
I have installed XAMPP server on my system to be able to use PHP.
I have installed Tomcat 6 and apache XAMPP on MAC OS. XAMPP includes MySQL.
I have XAMPP installed on my computer, and am using MySQL through it on
I have XAMPP (Apache + MySQL + PHP) installed on my computer and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.