Archive | JSP Basics RSS feed for this section

Mysql + JSP Example

Java Database Connectivity (JDBC) is an API that lets you access any tabular data sources from a Java application.
This example shows a JSP that queries a UserInfo table using JDBC.

Name
password

Read full storyComments { 1 }

Mysql Connection

public static Connection getConnection() throws Exception {
String driver = “com.mysql.jdbc.Driver”;
String url = “jdbc:mysql://localhost/ev?”;
String username = “root”;
String password = “0532″;
Class.forName(driver); // load Oracle driver
return DriverManager.getConnection(url, username, password);
}

Read full storyComments { 1 }