<!--first we've to import the necessary packages-->
<!--importing packages starts-->
<%@ page info="database handler"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="javax.servlet.*"%>
<%@ page import="javax.servlet.http.*"%>
<!--importing packages ends-->
<%
try
{
//loading the drivers
//this code loads JDBD-ODBC Driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//making connection
//The second step in establishing a connection is to have the appropriate
//driver connect to the DBMS. The following line of code illustrates the
//general idea:
String url="jdbc:odbc:jimmy";
//where "test" is the system dsn name
Connection con=DriverManager.getConnection(url, "sa", "");
//where "administrator is the username to
//access the database and password is " password"
//DriverManager's getconnection method estabilishes connection
//with the database specified in the JDBC URL
//Then create jdbc statement
Statement stmt = con.createStatement();
String query="CREATE TABLE COFFEES" +
"(COF_NAME VARCHAR(32),"+
"SUP_ID INTEGER,"+
"PRICE FLOAT,"+
"SALES INTEGER,"+
"TOTAL INTEGER)";
//Execute the statement
stmt.executeUpdate(query);
}
catch (Exception e) {}
//give confirmation message
out.println("table coffees created");
%>
----- Original Message -----
From: "Nick" <[EMAIL PROTECTED]>
To: "JRun-Talk" <[EMAIL PROTECTED]>
Sent: Monday, July 16, 2001 1:08 PM
Subject: Using Jrun JDBC without using consule.
> Hi:
>
> How can I use the JRun JDBC drivers inside my JSP directly? How do I refer
> the the files (Jars)?
>
> Thanks,
>
> Stefan
>
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists