Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java newbie - jdbc example.

 
Stefan Renemeister
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://java.sun.com/docs/books/tutorial/jdbc/index.html
 
Campbell Ritchie
Sheriff
Posts: 48917
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 684
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

http://java.sun.com/products/jdbc/reference/codesamples/index.html#1
 
Stefan Renemeister
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all,

it took me a while to read most of your links, but especially sun's JDBC was really nice.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic