|Java and MySQL|
Java & MySQL
The full documentation and information about MySQL can be found at http://www.mysql.com/documentation/index.html, Alternatively, MySQL by Paul DuBois is a good reference (ISBN 0-7357-0921-1)
Test your MySQL Servlet Account is working
At this point it is assumed that the basic servlets are working. To see how to test this go to Using Servlets
To test that the connection to MySQL is working, open up a web browser and go to
http:// webserver /mountpoint / testDB2020
Both of these are in the account detail letter.
This should bring up a page looking like:
2020Media Database Servlet Connection Working
You have connected successfully
If this does not happen, then contact support.
Connecting to MySQL
The following code fragments show the supported method of connecting to MySQL.
db_username , db_password, db_servername and db_database are detailed in your account information.
We urge you to use code as close to this as possible, as it aids our debugging of any problems.
The source for the test page is available in the 'src' directory.
Accessing the Database
To access the database for creating tables and monitoring status, you may need to run an MySQL client. This can be done either from the command line or from your own computer.
Using the command line
There is a command line client which can be accessed by typing
mysql -u db_username -p -h db_hostname
This allows you to access the database from the command line. It is not very user friendly, but allows you to execute SQL commands directly.
You will then be prompted for your Database password. It should then return a prompt. You can then type in commands - followed by the word ';' .
This should return a list of databases and some information about them. More details on using MySQL can be found here.
|< Prev||Next >|