Jdbc connectivity by type 4 driver

Ads
 

Jdbc connectivity by type 4 driver

I have done a code with database connectivity with driver 4,it copiles,but while running it is showing java.lang.ClassNotFound exception..the code is following...

import java.sql.*;
class JdbcDemo1
{
static Connection con=null;
public static void main(String args[])
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521","system","123");
System.out.println("connection established");
Thread.sleep(1000);
Statement stmt=con.createStatement();
String createTable="create table test(name varchar2(20),fname varchar2(20))";
   stmt.executeUpdate(createTable);
System.out.println("Table created successfully");
   Thread.sleep(1000);

   String insertQuery="insert into test values('raja','papa')";
   stmt.executeUpdate(insertQuery);
System.out.println("Records inserted successfully");
Thread.sleep(2000);
System.out.println("Plz,wait....data is fetching...");
Thread.sleep(2000);
ResultSet rs=stmt.executeQuery("select * from test");
while(rs.next())
{
System.out.println("name = "+ rs.getString(1) + "fname = "+ rs.getString(2) );
}
}
catch (Exception e1) 
{ 
e1.printStackTrace(); 
} 
finally 
{ 
        try 
          { 
         con.close(); 
          } 
       catch (Exception e1) 
          {         
e1.printStackTrace();
          }
}
}
}.....end of code

please help me out as soon as possible...i m waiting...and i m using oracle 11g as database.

View Answers

March 11, 2013 at 6:44 PM

hi friend,

Probably you aren't deploying the oracle driver with your application.

Ads









Related Tutorials/Questions & Answers:
Jdbc connectivity by type 4 driver
Jdbc connectivity by type 4 driver  I have done a code with database connectivity with driver 4,it copiles,but while running it is showing...=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521","system","123
type 4 jdbc driver
type 4 jdbc driver   i read in this site that type 4 jdbc driver is the fastest one so used it to connect with the database.......but not tried another drivers,....can u specifically answer me why type 4 is the fastest one
Advertisements
java- jdbc with type 4 driver
java- jdbc with type 4 driver  My program code is----- import... and Register the JDBC driver:*** DriverManager.registerDriver(new... = DriverManager.getConnection("jdbc:oracle:[email protected]:1521:XE", "system", "oracle"); Statement
Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4  Hi, In my Hibernate application following error is coming: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less
JDBC CONNECTIVITY
JDBC CONNECTIVITY  How do i connect my database to java. I have the connector file and i place it in lib of jdk folder and installed the jdbc driver... file in environment variable.   Java Mysql connectivity Other JDBC
JDBC CONNECTIVITY - JDBC
of JDBC drivers. Each driver has to be register with this class. getConnection...- This is the class where Type 1 Driver is implemented. For more information, visit...JDBC CONNECTIVITY  String jclass="sun.jdbc.odbc.JdbcOdbcDriver
jdbc connectivity to mysql tutorial
jdbc connectivity to mysql tutorial  here is complete jdbc connectivity to mysql tutorial for newbies. Person who don't even know how to install mysql and don't know about which driver to use can do with ease
JDBC CONNECTIVITY
connectivity Other JDBC Tutorials...JDBC CONNECTIVITY  import java.sql.Connection; import..."); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/abhi
jdbc connectivity
jdbc connectivity  import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.*; public class NewJFramefin extends...=e.getActionCommand(); String check; String str="jdbc:odbc:dsn1
JDBC Driver - JDBC
JDBC Driver  What are the diffrent types of JDBC driver
JDBC-Odbc Connectivity
JDBC-ODBC Connectivity       The code illustrates an example from JDBC-ODBC Connectivity. The code helps you in retrieve the name and size of the column
jdbc oracle connectivity problem
jdbc oracle connectivity problem  Hi All, I am trying to connect my swing application to oracle DB . but class.forname is giving error. Please suggest me if there is some different way to connect swing application to oracle
JDBC Driver
JDBC Driver  I want to know the clear syntax and usages of $ types of JDBC drivers. Where can i get it? I search for it, nobody give Syntax for tat different drivers. can u give a sample codes for tat
How to Retrieve Excel data into mysql using type 2 JDBC-ODBC driver
How to Retrieve Excel data into mysql using type 2 JDBC-ODBC driver  ... type 1 driver and i have done successfully.but disadvantage is when i create... Sources(ODBC) Open User DSN tab Add a user DSN Select Microsoft Excel Driver
jdbc connectivity through jsp
jdbc connectivity through jsp  my code: <%@ page language="java...="Content-Type" content="text/html; charset=ISO-8859-1"> <title>hi to all<... = ""; String url = "jdbc:mysql://localhost/interviewer
How to download MySQL JDBC driver?
How to download MySQL JDBC driver?  Hi, What is JDBC Driver? How to download MySQL JDBC driver? Thanks   Hi, JDBC - Java database... program. To connect to MySQL database from Java program we need JDBC Driver of MySQL
mysql jdbc connectivity
mysql jdbc connectivity  i want to connect retrieve data from mysql using jdbc
code to establish jdbc database connectivity in jsp
code to establish jdbc database connectivity in jsp  Dear sir, i'm in need of code and procedure to establish jdbc connectivity in jsp
code to establish jdbc database connectivity in jsp
code to establish jdbc database connectivity in jsp  Dear sir, i'm in need of code and procedure to establish jdbc connectivity in jsp
jdbc type-4 driver
jdbc type-4 driver  I was tried the code that you give to run type-4 driver . import java.sql.*; import oracle.jdbc.driver.*; import oracle.sql.*; while compiling the error was like: package oracle.jdbc.odbc.driver does
maven mysql jdbc driver
maven mysql jdbc driver  How to add the maven mysql jdbc driver dependency in the pom.xml file of a maven based application?   Hi, Its simple!! Add the following into your pom.xml file: <dependency> <
JDBC Connectivity Code In Java
JDBC Connectivity Code In Java      ... in understanding JDBC Connectivity Code in Java. In this program, the code returns you the time set by the driver to connect url and database. For this we
JDBC Components
the JDBC drivers. Each driver has to be registered with this class. 4. getConnection... Database Connectivity. For connectivity with the database we uses JDBC... platform, it includes the Java Standard Edition. 2. JDBC Driver Manager The JDBC
JDBC Video Tutorial: How to download JDBC Driver for MySQL?
for downloading the JDBC Driver. This database driver is JDBC Type 4 database driver...First thing to develop the JDBC program is to download the JDBC Driver... the MySQL database, so we have download the JDBC Driver for the MySQL
Video Tutorial: How to download JDBC from MySQL?
Java driver Type 4: It denotes the pure Java/Native protocol driver For more... JDBC driver for mysql. The following steps shall guide you to a successful... file Here is the video tutorial of "How to download JDBC Driver
Version of com.qwazr>jdbc-cache-driver dependency
List of Version of com.qwazr>jdbc-cache-driver dependency
Chapter 4. Demonstrate understanding of database connectivity and messaging within IBM WebShpere Application Server
Resources > JDBC Providers > Cloudscape JDBC Driver > Data Sources >...(select.getColumnAsString(4)); } while (select.next()); } // Release the JDBC... Chapter 4. Demonstrate understanding of database
JDBC 4 Features, JDBC 4.0 Features
.style1 { margin-left: 40px; } JDBC 4 Features In this section we are discussing about the new features of JDBC 4.0. Jdbc 4.0 ships with Java SE 6..., SQL XML data type etc. Here are some features of jdbc 4.0 1. Auto loading
MySQL JDBC Driver pom dependency code
MySQL JDBC Driver pom dependency code  Hi, What is the POM dependency code for MySQL's latest JDBC Driver? I can download the MySQL driver from mysql website but I need to use it in a application which is based on Maven 3
how to set fetch size for jdbc odbc driver
size for the JDBC ODBC driver and how can i fetch a set of results for JDBC ODBC driver?   Fetching results JDBC ODBC Driver A. The default fetch.... To fetch small number of rows from database, JDBC driver is designed so
the JDBC Driver has been forcibly unregistered
the JDBC Driver has been forcibly unregistered  Hi my application... application was st opped. To prevent a memory leak, the JDBC Driver has been... the web application was stopped. To prevent a memory leak, the JDBC Driver has been

Ads