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 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.









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:thin@localhost:1521:XE", "system", "oracle"); Statement
type 4 drivers - JDBC
type 4 drivers  Hi! What is the syntax for Type - 4 drivers. give me any sample code. Thanks in advance..  Hi Friend, Please visit the following link: http://www.roseindia.net/jdbc/jdbc-driver-and-its
Fastest type of JDBC Driver
Fastest type of JDBC Driver  hello, What is the fastest type of JDBC driver?   hii,ADS_TO_REPLACE_1 Type 4 is the fastest JDBC driver
fastest type of JDBC driver
fastest type of JDBC driver  What is the fastest type of JDBC driver
Jdbc Driver - JDBC
JDBC Driver Types  Type of JDBC Driver  four..Type 1(JDBC-ODBC Driver)Type 2(java native driver)Type 3Type 4  Type of JDBC... as: * JDBC-ODBC bridge plus ODBC driver, also called Type 1. * Native-API
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
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
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
connectivity - JDBC
driver for JDBC and set in the Tomcat/lib folder and if any more problem give full..., Please check the jar file for Connection driver for JDBC and set in the Tomcat... as follows ------------------------------------------------------------------- type
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
database connectivity - JDBC
a user DSN 4. Select Microsoft Access Driver(*.mdb) 5. Select database name... connectivity programs with MSacces   Hi Friend, If you havn't create your.... For programs,visit the following links: http://www.roseindia.net/jdbc/Jdbc-odbc
JDBC CONNECTIVITY
connectivity Other JDBC Tutorials...JDBC CONNECTIVITY  import java.sql.Connection; import..."); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/abhi
connectivity - JDBC
connectivity  How can we connect sql server using Java   Hi Friend, By using JDBC drivers, you can connect SQL server with java. Please visit the following link: http://www.roseindia.net/jdbc/jdbc.shtml
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 is the fastest one
JDBC driver is the fastest one  Which type of JDBC driver is the fastest one
JDBC Connectivity - JDBC
JDBC Connectivity  my question is how to connect a Java program... String filename = "d:/java/mdbTEST.mdb"; String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="; database
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am...; String url = "jdbc:mysql://localhost:3306/"; String dbName = "jdbctutorial"; String driver = "com.mysql.jdbc.Driver"; String userName
jdbc driver
jdbc driver  hello, can we create a own jdbc driver? how can we create
no driver - JDBC
{ try { //Loads Type 2 Driver Class.forName...()); System.exit(1); } /* Type 2 driver url */ //String url... the program: run: SQL Exception: No suitable driver found for jdbc:db2
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
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 Driver and Its Types
4. Type 1 Driver- the JDBC-ODBC bridge The JDBC.... Type 4 - the Native-Protocol Driver The JDBC type 4 driver, also... for Java JDBC driver is a Type 4 JDBC driver, indicating that the API is a pure
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
Best JDBC Driver and Why - JDBC
Best JDBC Driver and Why   Hi Friends , In JDBC 4 drivers are there among this which is best and why. which driver is most commonly used in web application
Java JDBC driver
Java JDBC driver  What is JDBC Driver
What is JDBC Driver ?
What is JDBC Driver ?  What is JDBC Driver
JDBC Driver interface
JDBC Driver interface  What is JDBC Driver interface
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
database connectivity - JDBC
."); Connection conn = null; String url = "jdbc:mysql://localhost:3306/"; String dbName = "databasename"; String driver = "com.mysql.jdbc.Driver... { Class.forName(driver).newInstance(); conn = DriverManager.getConnection(url
Which JDBC Type Using - Java Beginners
Which JDBC Type Using  As there are 4 types of JDBC driver. I wanted to know: How would one come to know that which jdbc type any web application... friend, Read for more information. http://www.roseindia.net/jdbc
regarding connectivity program only - JDBC
= "jdbc:mysql://192.168.10.211:3306/"; String db = "amar"; String driver...regarding connectivity program only  can u give me code regarding..., i am sending simple code of connectivity import java.sql.*; public
JDBC, Java Database Connectivity
tutorials. Java Database Connectivity or JDBC for short is Java bases API... we need the JDBC driver for oracle and so on. Here is the List of JDBC drivers for major databases. You can download the JDBC driver for your database
MySQL Driver for JDBC - JDBC
MySQL Driver for JDBC  Sir, I have started reading your JDBC tutorial...... Example."); Connection conn = null; String url = "jdbc:mysql://localhost:3306   Hi,Please download the driver from http://www.mysql.com/products/connector
jdbc driver for mysql - Java Beginners
of jdbc-mysql database connectivity and idea about jdbc and mysql driver...jdbc driver for mysql  I need jdbc driver program for connecting java progrma to mysql. Please any one send me the url to download the driver
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou
mysql jdbc connectivity
mysql jdbc connectivity  i want to connect retrieve data from mysql using jdbc
Eclipse Connectivity - JDBC
Eclipse Connectivity  Hello Friends.. I want to do connectivity... connectivity..and which plugins are required for it. i have try to do connectivity but i got given below error. "Error Occured Error
Confused in driver - JDBC
Confused in driver  I am confused about the concept Driver in JDBC. Although i know jdbc very well(in respect... mean to say theoretically it is not cleared please explain me the type of driver... of some picture i want o know
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
Product Components of JDBC
. The JDBC Driver Manager. 3. The JDBC Test Suite. 4. The JDBC-ODBC Bridge.ADS... Bridge. The JDBC-ODBC bridge, also known as JDBC type 1 driver is a .... The JDBC Driver Manager. The JDBC Driver Manager is a very
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
database connectivity in java - JDBC
database connectivity in java  import java.io.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.sql.*; class... con1; con1=DriverManager.getConnection("jdbc:odbc:Mycon
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
Set properties for a JDBC driver
Set properties for a JDBC driver  How do I set properties for a JDBC driver and where are the properties stored
Java vs Oracle Connectivity - JDBC
) Load and Register the JDBC driver:*********** DriverManager.registerDriver... are using oracle oci driver,you have to use: Connection conn = DriverManager.getConnection("jdbc:oracle:oci8: @oracle.world", "root", "root"); where

Ads