514 Part IV . Development Figure 17-32: The (Web hosting mysql)

514 Part IV . Development Figure 17-32: The error message given when the CLASSPATH variable hasn t been set For more information on installing and using the Java Software Development Kit, see the Sun Web site, http://java.sun.com. Using the JDBC and the MySQL Driver The JDBC itself defines the methods by which you connect to a database. This section looks at how to create a connection to a MySQL database and issue statements with the JDBC. Before doing so, I d like to go over some basic terminology and concepts. The concepts and terms of JDBC The first step involved in making the JDBC work with a database is loading a driver. The JDBC java.sql.DriverManagerclass performs this task. The DriverManager class also works with the Driver so you don t need to. The forName() method loads the Driver class. Note Although you can also load the Driver class by using jdbc.drivers, I recommend using the forName() method for the sake of consistency. The Class.forname() method takes a string as an argument. In the case of the MySQL JDBC driver, this string is: org.gjt.mm.mysql.Driver For example: Class.forName( org.gjt.mm.mysql.Driver ); The getConnectionmethod is called to make the actual connection to the database server. The DriverManager creates a Connection object when you call
You want to have a cheap webhost for your apache application, then check apache web hosting services.

Leave a Reply