<% @ Page Import = "java.sql. *"%>
<% @ Page Import = "java.io. *"%>
<% @ Page Import = "java.util. *"%>
<%
Java.sql.connection lconn = NULL;
Java.sql.Statement Lstat = NULL;
Java.sql.resultset lrs = null;
Try
{
DriverManager.RegisterDriver (new oracle.jdbc.driver.OracleDriver ());
String Lurl = "Java: Oracle: Thin: @ 192.168.0.28: 1521: junzi";
// java: Oracle: Thin: means that this is this driver
@ SRV: 1521: Represents the name and port number of the server used
// DBNAME: Indicates the SID of the database
LCONN = DriverManager.getConnection (LURL, "GU", "jian");
LSTAT = lconn.createstatement ();
// Create a table
String CreateTableCoffees = "CREATE TABLE COFFEES"
(COF_NAME VARCHAR (32), SUP_ID INTEGER, Price Float, "
"Sales Integer, Total Integer";
Lstat.executeUpdate (CreateTableCoffees);
// Insert data
LSTAT.EXECUTEUPDATE ("INSERT INTO COFFEES VALUES ('Colombian', 101, 7.99, 0, 0)");
LSTAT.EXECUTEUPDATE ("INSERT INTO COFFEES VALUES ('Espresso', 150, 9.99, 0, 0)");
LSTAT.EXECUTEUPDATE ("INSERT INTO COFFEES VALUES ('Colombian_Decaf', 101, 8.99, 0, 0)");
LSTAT.EXECUTEUPDATE ("INSERT INTO COFFEES VALUES ('French_roast_Decaf', 49, 9.99, 0, 0)")
//search result
Lrs = LSTAT.ExecuteQuery ("Select * from coffeees");
//Show results
Out.println ("