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
by teddy on 28. Mar, 2010 in JSP Basics
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
by admin on 28. Mar, 2010 in JSP Basics
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);
}
© 2010 Java Resources. All Rights Reserved.

Recent Comments