Add exo9 code.
[TD_webapps.git] / ROOT / exo9 / connectJspMysql.jsp
1 <%@ page import="java.io.*, java.util.*, javax.servlet.*, java.sql.*" %>
2 <%
3
4 try {
5 String connectionURL = "jdbc:mysql://localhost/bdVols";
6 Connection connection = null;
7 Class.forName("com.mysql.jdbc.Driver").newInstance();
8 connection = DriverManager.getConnection(connectionURL, "fraggle", "$Love79!");
9 if(!connection.isClosed())
10 out.println("Successfully connected to " + connectionURL + " MySQL server using TCP/IP");
11 connection.close();
12 } catch (Exception e){
13 out.println("Unable to connect to database: " + e);
14 }
15
16 %>