• Skip to main content
  • Skip to primary sidebar

Founder at work

Master the skills to create and launch your next SaaS company

  • About Me
  • Reviews
  • Resources
  • Community
  • Contact
  • Lessons
  • Series
  • Search
  • Login

How to setup MySQL with java using ubuntu in netbeans?

November 4, 2013 by Rick Hernandez 1 Comment

Assumptions
  • Virtual Ubuntu box is reachable (IE. Network)
  • MySQL setup is running correctly
  • Root password is available!
Let’s get started | Download jdbc connector

Go ahead and get the jdbc connector here or just run the following command

Setup database and tables

Log in to MySQL with root

Now let’s create a database called java, and a table called javaTable for this example, will just store the first name, last name and set a primary key to the id.

User authentication

For best practice let’s create a user, that will only be able to interact with the java database and give all privileges.

  • Username: javaUser
  • Password: oHeyJava

Now that we have a new user let’s log in with those credentials

Now let’s make sure that the database and tables are viewable

Setting up connection on Mac OSX Maverick 10.9 with netbeans

Now that the virtual server is up and running let’s setup netbeans with a new project and call it javaCRUD

Java CRUD in netbeans

Now right click on the project and go to the properties then libraries

Screen Shot 2013-11-04 at 1.57.26 AM

Now click on add library select MySQL JDBC Driver click on add to library, click on ok

Screen Shot 2013-11-04 at 1.57.41 AM

Now that it’s setup lets write some code

Having network issues?

Wrapping it up

Now at this point, compile and run the class.

Rick Hernandez

I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Filed Under: Java, MySQL, Programming

Primary Sidebar

Learn How To Take Your Idea And Convert It Into An App From Scratch Even If You Have Never Written A Single Line Of Code.

  • How to Find Your Next Great App Idea
  • The Secret To Getting PAID To Build Your Own App
  • How To Create Your App (SaaS, Mobile, VR, AR, Game)
  • How To Monetize Your Apps
Learn More
4.82 Ratings

Copyright © 2025 · JSecademy Blog Theme on Genesis Framework · WordPress · Log in