I am beginner to MySQL. What should i include in a JSP page to connect to MySQL database?
Is it possible to have an example page coding??:D
Printable View
I am beginner to MySQL. What should i include in a JSP page to connect to MySQL database?
Is it possible to have an example page coding??:D
To connect to a database in JSP (java) you need to do a number of things:
Define the JDBC driver: Class.forName(DriverName)
Get the connection: java.sql.DriverManager.getConnection (URL,username,password);
The URL is something like - "jdbc:odbc:Fred" where Fred is the data source.
This might be a bit confusing so go to http://java.sun.com/docs/books/tutor...ics/index.html for a tutorial sort of thing.
If you need more help I don't mind doing it (above is what I can remember off the top of my head - might be wrong)- but I need access to my programs which are at work :rolleyes:
HD