Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old January 22nd, 2004, 04:08 AM
satchuu satchuu is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 14 satchuu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Regarding Thin Clients

I have a problem with Connecting to thin driver. I dont know how to connect to it.. I have a oracle server and i set the classpath to classes 12.zip file. and i m trying to execute the following code in client machine to connect to the oracle server using thin client. But i m getting the exception that is
I m getting Exception in thread main No such Driver


/*
* This sample shows how to list all the names from the EMP table
*
* It uses the JDBC THIN driver. See the same program in the
* oci8 samples directory to see how to use the other drivers.
*/

// You need to import the java.sql package to use JDBC
import java.sql.*;

class Employee
{
public static void main (String args [])
throws SQLException
{
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

// Connect to the database
// You must put a database name after the @ sign in the connection URL.
// You can use either the fully specified SQL*net syntax or a short cut
// syntax as <host>:<port>:<sid>. The example uses the short cut syntax.
Connection conn =
DriverManager.getConnection ("jdbcracle:thin:@dlsun511:1721:dbms733",
"scott", "tiger");

// Create a Statement
Statement stmt = conn.createStatement ();

// Select the ENAME column from the EMP table
ResultSet rset = stmt.executeQuery ("select ENAME from EMP");

// Iterate through the result and print the employee names
while (rset.next ())
System.out.println (rset.getString (1));
}
}

What is the solution?
Thankyou.

Reply With Quote
  #2  
Old January 22nd, 2004, 08:27 AM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 5
You should try to write the exception controlled program to find the exact code that are causing to generate the error, like that:

class Employee
{
public static void main (String args [])
throws SQLException
try{
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
}
catch (Exception e){
System.out.println("Driver not found.............");
}

Use the following code to load the driver:

try{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch(ClassNotFoundException e) {
System.err.println("Error loading driver: " + e);
}

Where you have saved the classes12.zip file in your directory?
which webserver are you using?
Did you have defined a proper classpath?

Regards

Reply With Quote
  #3  
Old January 22nd, 2004, 11:14 PM
satchuu satchuu is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 14 satchuu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thin client

The following program that i sent u got executed properly later. But it happens only if set the classpath is set to classes111.zip file in client system.

It means in my client PC, If i want to connect to oracle server database, I need to have classes111.zip file in my PC and i have to set the classpath to it.

But this classes111.zip file will come along with oracle client installation.

But i want a solution of connecting to the database, without having client version of oracle installed in my PC.
Means, I want to connect to the server database with no class files like classes111.zip file in my system..

So, if i m trying to execute the same program in a PC where no oracle client installed, Then i m getting an exception called OracleDriver Not found during compilation itself.

How to connect to database now..
What is the other way solution.
Is it compulsory to have oracleDriver installed in all client PCs where we want to connect to server?

What is this server-side thin driver?
What is this client-side thin driver?
What is this server-side Internal driver?

Thankyou

Reply With Quote
  #4  
Old January 23rd, 2004, 01:49 AM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 932 shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 22 m 43 sec
Reputation Power: 54
Quote:
Means, I want to connect to the server database with no class files like classes111.zip file in my system..


That is not possible, where would you load the JDBC driver from?

You need the oracle JDBC driver on the client's machine (just like you need your application on the client machine).
You can distribute the .jar/.zip file together with your application (should be part of your application's installation)

What JDK and Oracle Version are you using? classes111.zip is for JDK 1.1.x you shouldn't use that for your apps (The Oracle tools still use JDK 1.1 that's why it's include therer)

Then there is a classes12.zip which is for JDK 1.2, and a ojdbc14.jar which should be used with JDK 1.4 and any newer Oracle version (it works with 8.1.x and 9.x even though the download link to ojdbc14.jar is only available through the 9.x links on Oracle's site) If you have a 9.x client installation ojdbc14.jar should already be on your machine.

I suggest you use ojdbc14. jar and bundle it together with your application. Use an executable .jar file for your app, and include the JDBC driver in the classpath definition for your .jar's manifest file.

Reply With Quote
  #5  
Old January 23rd, 2004, 09:33 AM
tron's Avatar
tron tron is offline
SwollenMember
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Austin, TX or the master control
Posts: 231 tron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 26 sec
Reputation Power: 8
you could connect without classes12.zip, however you would need something like OCI...which in short would mean you would have a bunch more crap on the client. if your goal is to have no extra oracle software on the client then i would suggest writing a server side app which requires the client only have a browser.

Reply With Quote
  #6  
Old January 23rd, 2004, 02:23 PM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 932 shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 22 m 43 sec
Reputation Power: 54
Quote:
you could connect without classes12.zip, however you would need something like OCI..


That is not correct

classes12.zip contains a level 4 JDBC driver, which means that it is implemented 100% Java and does not rely on any other software.

When you use the thin driver (by putting the thin keyword in the JDBC url) you don't need anything besides your program and the classes12.zip (or ojdbc14.jar)

Reply With Quote
  #7  
Old January 24th, 2004, 10:35 AM
tron's Avatar
tron tron is offline
SwollenMember
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Austin, TX or the master control
Posts: 231 tron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 26 sec
Reputation Power: 8
read the post. he does not even want to use classes12...this is considered 'other oracle software' to him. btw who do you think wrote classes12.zip?

http://otn.oracle.com/software/tech...cs/jdbc817.html

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Regarding Thin Clients


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway