Using PHAkT v1.0: Connecting to a MySQL Database using JDBC

This tutorial takes the user through using the new JDBC connection method for UltraDev's PHP server model PHAkT. This tutorial is a lot shorter than the MyODBC tutorial, as this is a much simpler way to connect. It is aimed at the MAC or PC user.
Using PHAkT v1.0
Connecting to a MySQL Database using JDBC
Connecting to a MySQL Database from within UltraDev can be a little daunting, especially if you're new to UltraDev. There are currently two ways you can do this. The first is using an ODBC connection, and the second is using a JDBC connection.
This tutorial covers the second option, JDBC. If you are a Macintosh user then a JDBC connection is your only option. However, this tutorial applies equally to users of the PC or Macintosh versions of UltraDev.
To complete the tutorial you will need to install the MySQL JDBC Driver. I have designed an extension that makes this process simplicity itself. Download the extension from here , and install it into UltraDev using the Extension Manager. There is nothing to configure, once the extension has installed, restart UltraDev and the JDBC Driver is ready for use.
Done that ? Great. Now we can create that connection !
Start UltraDev and open or create a page. Open the Data Bindings palette (Ctrl+F10, or Window->Data Bindings).

Click on the Define Connection button, and you should get a large window looking like this :-

Use the following points to help you complete this form :-
In the UltraDev Connection Section
- Connection Name: Should always start with 'conn' for example 'connMyDatabase'. This is so that whenever you look at the source code you will know immediately that any occurrence of connMyDatabase refers to your connection.
- DB Type: Should in this instance be set to MySQL. If you now click on the check radio button if nothing happens the MySQL JDBC driver is installed correctly.
- Host: This is the Hostname or IP Address of your MySQL server (I personally always use the IP Address).
- URL: This is where most people make a mistake, in that they replace all of the original value in this box, you should NOT delete this value. The original value in this box will be jdbc:mysql://hostname/DB_NAME. This will be slightly different depending on what you entered in the hostname box. You should replace DB_NAME with the name of the Database you wish to connect to. Remember that this name should not contain any punctuation or spaces.
- User Name: This should be your MySQL Username
- Password: This should be your MySQL Password
In the PHP Connection Section
- dB Type: Should be set to MySQL.
- Host: Should be the Hostname or IP Address of the MySQL Server.
- User Name: Should be your MySQL Username (yes, you have already entered this above)
- Password: Should be your MySQL Password (yes, you have already entered this too).
Why do you have to duplicate the MySQL information ? Well, there are times when you want to work using one server for development, and another server for actual deployment. In these situations, before deploying your site you would edit the connection, and enter the information for your deployment MySQL server in the PHP Connection section above. When you do this the two sets of information will be different.
Once you have completed this form, click on Test. An alert box should pop up saying 'Connection was made successfully'. Click on OK and you are ready to use the Database functions within UltraDev via a JDBC Connection.
Tim Green
36 Years Old and recently married. Initially started as a COBOL, PASCAL, FORTRAN, ALGOL, 6502 and Z80 Assembly language programmer at age 16.
At age 19 I chased a career in acting where I had a couple of 'Extra' roles and appeared in 'Robin Hood' (no not the Kevin Costner one). Missed out on my big break when I contracted pneumonia which stopped me working on Aliens 3.
Following a 5 year stretch as a casual barman, chef and waiter on Spain's Costa Brava, I returned to the UK where I began work, on a VERY busy IT Support helpline.
Quickly moving through the ranks to Team Leader of Hardware, Software, 2nd level and Principle Support, I finally left after raising the service level from 17% to 98% and getting demoted by way of reward.
CEO of The Rawveg Consultancy, I provide custom extension development services, IT Consultancy, B2B and eBusiness consultancy services.
User Reviews
Total of 23 reviewsRE: nothing to download
Written by Tim Green on June 6, 2003This tutorial was written on July 18, 2001, and has since been superced by a number of different versions of PHAkT. This tutorial was aimed at an early edition of PHAkT, and is no longer required. It remains here for historical purposes only.
nothing to download
Written by Donna South on June 5, 2003I would love to do the tutorial but the extension is unavailable. Do you have a update to this?
RE: Error Message
Written by Tim Green on May 22, 2002Yes, you need to upload your adodb directory to your webspace too.
Error Message
Written by andy budd on May 22, 2002I've installed PHAkT and the JDBC extension on this site and am trying to connect to a mySQL server on my Raq4. I can create a connection and see the tables and column values in the recored set test window. However when I try to test a simple page I ...
RE: RE: connection_php_mysql.htm ?????????
Written by Eric Kaiser on May 7, 2002You da Man. I did create a new connection with MX when I had it installed. I named it exactly as my previous connection using PHAKT, probably not a smart thing to do. I didn't realize the MX trial version was actually BETA, thanks for that info too!
RE: connection_php_mysql.htm ?????????
Written by Tim Green on May 7, 2002This problem occurs because when you tried to use Dreamweaver MX, you obviously created a new database connection.Simply delete this new connection from your site, and you will no longer receive the error. Please remember that the Public Preview of ...
connection_php_mysql.htm ?????????
Written by Eric Kaiser on May 7, 2002I installed the MX trial version and had problems using my already established PHP projects using PHAKT's extension. So, I uninstalled MX and it totally destroyed UD 4 on my machine. Tons of errors. I reinstalled UD 4, with the udpate to 4.01. I ...
RE: Server Configuration denies access to data source
Written by gary kim on May 6, 2002I am also getting error message. 'Server configuration denies access to data source' Could you please verify what it means to have a remote server or a local one? I ran a test script that.. whenever I set the HOST to 'localhost' and run the script ...








