Step - 1 :- Copy Oracle JDBC folder's *.jar files and classes111.zip or classes12.zip
Step - 2 :- Paste java->jdk->jre->ext->lib Folder
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@page import="java.net.*"%>
<%@ page import="oracle.jdbc.driver.*" %>
<%@ page import="oracle.sql.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="java.math.*" %>
<%@ page import="java.*" %>
<%
Connection con = null;
Statement stat = null;
ResultSet rs = null;
String sql=null;
try
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:databasename","scott","tiger");
stat = con.createStatement();
}
catch(SQLException e)
{
out.print("Error = " + e );
}
%>
Step - 2 :- Paste java->jdk->jre->ext->lib Folder
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@page import="java.net.*"%>
<%@ page import="oracle.jdbc.driver.*" %>
<%@ page import="oracle.sql.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="java.math.*" %>
<%@ page import="java.*" %>
<%
Connection con = null;
Statement stat = null;
ResultSet rs = null;
String sql=null;
try
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:databasename","scott","tiger");
stat = con.createStatement();
}
catch(SQLException e)
{
out.print("Error = " + e );
}
%>
No comments:
Post a Comment