How to access a MySQL database from Java code?

How to access a MySQL database from Java code?

Post by azsx » Wed, 05 Jul 2006 20:42:59


Please help me learn how can I create a MySQl database and then
modify/update it with Java. Please give me some helpfull code...
 
 
 

How to access a MySQL database from Java code?

Post by Ian Wilso » Wed, 05 Jul 2006 23:02:13


I found that Googling for JDBC throws up some helpful code.

Third item:

"This document illustrates the basics of the JDBC (Java Database
Connectivity) API (Application Program Interface). Here, you will learn
to use the basic JDBC API to create tables, insert values, query tables,
retrieve results, update tables, create prepared statements, perform
transactions and catch exceptions and errors.

This document draws from the official Sun tutorial on JDBC Basics. "

 
 
 

How to access a MySQL database from Java code?

Post by David Harp » Thu, 06 Jul 2006 17:12:10


There are plenty of books on JDBC programming. The O'Reilly title
"Database programming with JDBC and Java" is a perfectly good one, with
plenty of example code snippets and full working programs, which can
also be downloaded from the O'Reilly web site.

As Ian Wilson has pointed out, the Sun tutorial on JDBC programming is
available online, and that also contains many examples.

For MySQL-specific information, you should refer to the online
documentation for Connector/J, the MySQL JDBC implementation:

http://www.yqcomputer.com/

David Harper
Cambridge, England