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 7506839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:21:53+00:00 2026-05-29T22:21:53+00:00

I am to connect to a MySQL database from a Java application to store

  • 0

I am to connect to a MySQL database from a Java application to store images taken from a scanned form. When I run the program I get a Could not find or load main class error.

I have tried setting the classpath but still get the same error: Could not find or load main class. By the way, another java file I created in the directory compiles. When I try to set the classpath I also get the same error. Here is the (EDITED)code:

java -cp "C:\Documents and Settings\xxx\Desktop\ttt_manual_yyy\mysql\mysql-connector-java-5.1.6-bin" ImageUploader C:\Documents and Settings\yyy\Desktop\IMAGES localhost uuu nnn

Where localhost is database address,uuu is username,nnn is password

  • 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-05-29T22:21:55+00:00Added an answer on May 29, 2026 at 10:21 pm

    You’re not even specifying a class, and you need to put your classpath in quotes as it’s got spaces. So it should be something like:

    java -classpath "C:\Documents and Settings\...\ImageUpload" foo.ImageUploader
    

    where foo.ImageUploader is the fully-qualified name of the class containing the main method.

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

Sidebar

Related Questions

How can I connect to remote MySQL database through SSH from java application? Small
How do I connect from Java to a MySQL database? The Java is running
Using Java, I get this error when attempting to connect to a mysql database:
I am trying to connect to MySQL database with Java and I get the
I'm trying to connect to the MySql database from a Java servlet. I'm working
I am trying to connect to MySQL database from Java (MySQL is hosted in
How can I connect to a MySQL database from Windows Forms?
I am trying to connect to a remote mysql database from an iPhone. I
If a java desktop application from a client machine needs to connect to a
I am trying to connect my Java Applet to a MySQL Database. I know

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.