File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help in JDBC

 
felix thomas
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have oracle 8,0,5 installed on windows 98 system.
i want to use the java-oracle JDBC driver in my java code.

could anyone tell me the steps how to do it and what drivers to download and how.
let the farce be with you
 
Mahesh Mamani
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by felix thomas:
hi,
I have oracle 8,0,5 installed on windows 98 system.
i want to use the java-oracle JDBC driver in my java code.

could anyone tell me the steps how to do it and what drivers to download and how.

Hi,
U can download the driver from http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/jdbc805samp/jdbc805samp.htm
Set the classpath to the driver...
U can use this test program to test:
import java.io.*;
import java.util.*;
import java.sql.*;
class DbOraTest {


public static void main(String[] args)throws PasswordException{

Properties x = new Properties();
x.put("user","scott");
x.put("password","tiger");

try{
String url= "jdbc racle:thin:@8.95.0.234:1521:IFXT";
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection(url, x);
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("select * from news");

while(rs.next())
{
System.out.println(rs.getString(1));
System.out.println(rs.getString(2));
}

}
catch(Exception e){
System.out.println(e);
}
}

}

HTH

Mahesh
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this list of resources on hand so, here it is :
These should be all the Oracle resources you need to get started, get familiar with jdbc, trouble shoot your problems, and eventually become advanced!
download your oracle drivers and follow the download procedures
enable the client to connect(set environment)

To find all the Oracle specific code that you could ever need -->look for the "JDBC Samples" links
some more oracle code here
If you just want code snippets that explain various tasks.
if you come accross a problem, check this list before you post
if you come accross an Oracle SQLException, then you can investigate the ORA-XXXXX error messages and solutions here:
good luck,
Jamie
 
felix thomas
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks guys u are the best
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic