Re: How to modify a MySQL database...




"azsx" <radu_plugaru@xxxxxxxxx> wrote in message
news:1152012454.385890.275810@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Please help me learn how can I create a MySQl database and then
modify/update it with Java. Please give me some helpfull code...

Your questions are far too big to answer in detail in a newsgroup post.
There are many things that you need to learn before you can create databases
and then update them with Java.

This will get you started:

1. To learn how to create a MySQL database, visit the MySQL website.
Assuming that you have already downloaded and installed a fairly recent
version of MySQL, you can find the documentation on this page:
http://dev.mysql.com/doc/. As you'll see, you will have a choice between
several languages and formats for each of the recent versions of MySQL.
Click the appropriate links. You will probably want to look at Chapter 3,
Tutorial, first to learn the basics of connecting to the database, running
queries, creating the database etc. Bear in mind that they will show you how
to do these things from the MySQL command line, NOT from a Java program!

2. The technique most people use to communicate between Java and a MySQL
database is JDBC. Therefore, you will need to learn JDBC. You will need to
install a MySQL JDBC driver in your system. Then, you will be able to start
writing Java programs that talk with MySQL. Many people will create their
databases, tables, indexes etc. within MySQL and then limit their Java
programs to doing SELECT, INSERT, UPDATE, and DELETE against their database
but you can actually create your tables, indexes, and other database objects
in the Java program itself if you want to do so. If you do a Google search
on "JDBC Tutorial", you should find something that shows you the basic
techniques that you need for working with JDBC. Please bear in mind that
there are different versions of JDBC and the later versions of JDBC have
more capabilities - and more complexity - than the earlier versions.
Therefore, JDBC 3.0 does a lot more than JDBC 1.22. Be sure that your JDBC
tutorial is compatible with your JDBC driver. For example, if you do a JDBC
1.0 tutorial but have a JDBC 3.0 driver, your tutorial won't show you many
of the things that you can do.

If you have questions about using MySQL to create databases, tables, etc.,
the best place to ask those is in the MySQL mailings lists. Questions about
JDBC should be asked at comp.lang.java.databases.

--
Rhino



.



Relevant Pages

  • Re: Java and MySql program example ?
    ... > I am trying to learn Java and need an example program with MySql ... > MySql database. ... Database connection established ...
    (comp.lang.java.programmer)
  • Stuff the purple heart programmers cook up
    ... C To act like a framework for the JDBC driver developers. ... D To hide the specifics of accessing particular kinds of database ... Topic: Java 2: Survey Author: Chris Mc Devitt ... The JDBC ResultSet is actually an interface java.sql.ResultSet. ...
    (comp.lang.java.programmer)
  • Re: mysql vs sqlite vs hsql
    ... My question isabout benchmarks and multiple inserts & ... > I current have a mysql database of approx. ... lemme dispell the very common misconception that java is slow. ...
    (comp.lang.python)
  • Re: Mixing P/R philosophy with OO (within J2EE).
    ... I have observed the work of literally hundreds of Java developers. ... Treating a database like a mere "persistence storage mechanisms" is on ... JDBC - Never before in history were so many database API's ... Topmind, if you're reading this, isn't this a good example of OOP? ...
    (comp.object)
  • Re: What about a DBMS that wont be platform-specific
    ... This would be my first time doing this and the database is being ... There is no JDBC driver for Access. ... In Java, you can use databases which provide only ODBC drivers through the JDBC-ODBC ... Sun includes a JDBC-ODBC bridge with their standard distro, ...
    (comp.lang.java.databases)