C
circuit_breaker
<%@ page import="java.sql.*" %>
<html>
<head>
<title>Tables in cookbook Database</title>
</head>
Hi,
From the following JSP code, I'd like to send the "category_name"
fields to an applet which will display the information using labels,
textboxes and so on... How do I establish the connection?
Thanks
--------------------------------
<body bgcolor="white">
<p>Inventory Database:</p>
<%
Connection conn = null;
String url = "jdbc:mysql://localhost/Inventory";
String user = "inv_user";
String password = "mypassword";
Class.forName ("com.mysql.jdbc.Driver").newInstance ( );
conn = DriverManager.getConnection (url, user, password);
Statement s = conn.createStatement ( );
s.executeQuery ("SELECT * FROM categories");
ResultSet rs = s.getResultSet ( );
while (rs.next ( ))
out.println (rs.getString("category_name" ) + "<br />");
rs.close ( );
s.close ( );
conn.close ( );
%>
</body>
</html>
<html>
<head>
<title>Tables in cookbook Database</title>
</head>
Hi,
From the following JSP code, I'd like to send the "category_name"
fields to an applet which will display the information using labels,
textboxes and so on... How do I establish the connection?
Thanks
--------------------------------
<body bgcolor="white">
<p>Inventory Database:</p>
<%
Connection conn = null;
String url = "jdbc:mysql://localhost/Inventory";
String user = "inv_user";
String password = "mypassword";
Class.forName ("com.mysql.jdbc.Driver").newInstance ( );
conn = DriverManager.getConnection (url, user, password);
Statement s = conn.createStatement ( );
s.executeQuery ("SELECT * FROM categories");
ResultSet rs = s.getResultSet ( );
while (rs.next ( ))
out.println (rs.getString("category_name" ) + "<br />");
rs.close ( );
s.close ( );
conn.close ( );
%>
</body>
</html>