File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes java newbie - jdbc example. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java newbie - jdbc example." Watch "java newbie - jdbc example." New topic

java newbie - jdbc example.

Stefan Renemeister

Joined: Sep 26, 2009
Posts: 13
Hi all,

first let me say hi, as a new member!

I have created a database (mysql), with a table containing 2 columns: id (primary key) en photo (blob). I like to show the photo's by a java application. I like to avoid using hibernate right now, just plain java to show the records.

Can you help me for an exhaustive example?

I have crawled the net, looked through a lot of java books, and searched this forum, but couldn't find a satisfying answer to my question.

Thank you very much in advance.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Welcome to JavaRanch.

For starters, you'll need the MYSQL JDBC driver. Googling that exact phrase will lead you to it. It that doesn't come with instructions, then there's always the Sun Java Tutorial:
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46360
You should find these links useful:
MySQL documentation page.
MySQL 5.1 installation page.
MySQL handbook. The installation instructions are in chapter 2. Chapter about connector-J.
You are reminded you must follow the instructions to the letter. You can probably put your connector .jar in a different directory from that suggested, but the tiniest spelling error in the CLASSPATH or other details will mean the whole thing fails to work
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 684
I found the following pages to be a useful supplement to the Sun Java tutorial. In particular, you can download a lot of sample code which I found helpful
Stefan Renemeister

Joined: Sep 26, 2009
Posts: 13
Thank you all,

it took me a while to read most of your links, but especially sun's JDBC was really nice.
I agree. Here's the link:
subject: java newbie - jdbc example.
It's not a secret anymore!