• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JDBC, Help please

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
I'm told that to do database access from within my Java programs I don't need a JDBC driver at all. My environment is:
Personal Oracle7, Java1.3, Win98.
Can somebody please help me with a sample code and on how to set up things to get me started?
Thanks in advance
------------------
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Who told you that tail... I have hear of stories being told around the camp fire.... but....
I have never heard of this one....
Please correct me if I am wrong..!
I very !
Please review the following code that uses the oracle jdbc driver CLASSES111.ZIP. This file must be in you CLASSPATH.
The following code works with JDK1.3 on NT and Oracle 7.3.4 on unix.
<code>
import java.sql.*;

public class CreateCoffees {
public static void main(String args[]) {

String url = "jdbc racle:thin:@S0030947:1521:ispd1";
Connection con;
String createString;
createString = "create table COFFEES " +
"(COF_NAME varchar(32), " +
"SUP_ID int, " +
"PRICE float, " +
"SALES int, " +
"TOTAL int)";
Statement stmt;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
}

catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
con = DriverManager.getConnection(url, "userid", "password");
stmt = con.createStatement(); stmt.executeUpdate(createString);

stmt.close();
con.close();

} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
}
}
</CODE>
------------------
We learn more from our mistake's than from our success's.
[This message has been edited by Monty Ireland (edited October 16, 2000).]
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just as a note, we've moved over from the old classes111.zip to a newer classes12_01.zip to access Oracle 7. It has one or two peculiarities, but does seem to fix some serious peoblems which were present in the 111 driver. Good luck trying to find any support for Oracle 7 from Oracle's site, though.
 
Monty Ireland
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where can I find the new driver....
I been on oracle's technet...
Pls provide URL.
TIA

------------------
We learn more from our mistake's than from our success's.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Drivers can be found at
http://technet.oracle.com/software/tech/java/sqlj_jdbc/software_index.htm
Ram
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic