0

can you please give the steps how to make simple program of jdbc on mac .

I have eclipse on my mac .so I need steps what to do next so that can able to make program of jdbc ? I do lot of RND but they provide for windows.But I also download Mysql from this link http://dev.mysql.com/downloads/file.php?id=450342 and download workbench from this link http://dev.mysql.com/downloads/file.php?id=412161

Then can you please may I right ? or what next I have to do to make jdbc program ?

  • I found lot of example for window –  Jan 26 '14 at 01:40
  • But I need for mac ..how to configure mysql with eclipse .I will make program but I need initial steps –  Jan 26 '14 at 01:41
  • 1
    what exactly doesn't apply to mac which is working on windows? – jonasnas Jan 26 '14 at 01:43
  • Actually I am beginner in java .recently I run my dng files of mysql .It work fine .But now how to connect with my eclipse after running mysql server –  Jan 26 '14 at 01:46
  • searching for hello world mysql java should show you some tutorials – jonasnas Jan 26 '14 at 01:48
  • can you please tell I need only mysqlserver ? or I need workbench also –  Jan 26 '14 at 01:50

2 Answers2

0

There is not much difference at all in using a Mac than other platforms for working with JDBC.

JDK

You need an implementation of Java, a "JDK". See my answer to another question about installing Java 7 and Java 8 on a Mac, including links for downloading a JDK. Before doing the database stuff, be sure this works in the Terminal.app program: java -version

JDBC Driver

You need a JDBC driver specific to your particular database engine.

H2 Database

I suggest trying the H2 database rather than MySQL, only because it may be a gentler easier way to get started. H2 is pure Java, rather simple in terms of installing and administrating, and free-of-cost. H2 comes with its own JDBC driver. The H2 web site has a quick-start page and a tutorial page. It is not written explicitly for Mac OS X, but you should be able to "translate" as needed.

Oracle Tutorial

Then follow the JDBC tutorial provided by Oracle.


Also: StackOverflow is for specific questions on programming, not general or wide-ranging discussion.

Community
  • 1
  • 1
Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
0

Install and start MySql.

Download the MySql JDBC driver. Try here: http://dev.mysql.com/downloads/connector/j/. Extract all the files and add the jar to your eclipse project.

Now you can start coding. Look up the docs for DriverManager, Statement and ResultSet.

Ted Bigham
  • 4,237
  • 1
  • 26
  • 31