1 Answer - Sort by: Date | Rating
if you are using java and oracle then by using 'thin' driver you can do a connection......
the following are the steps:-
import java.io.*;
import java.sql.*;
class Contest
{
public static void main(String args[])throws SQLException
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.13:1521:
ora_sid","scott","tiger");
String st="select * from emp";
PreparedStatement ps=conn.prepareStatement(st);
ResultSet rs=ps.executeQuery();
while(rs.next())
{
String s1=rs.getString(1);
String s2=rs.getString(2);
String s3=rs.getString(3);
System.out.println(s1+" "+s2+" "+s3);
}
conn.close();
}
}
/*here 192.168.0.13 is the ip-address of the machine where oracle server is installed. If your system is a stand-alone one the instead of ip-address you can give "localhost" or loop-back address "127.0.0.1", and "1521" is the default port number of connecting oracle with java..*/
the following are the steps:-
import java.io.*;
import java.sql.*;
class Contest
{
public static void main(String args[])throws SQLException
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.13:1521:
ora_sid","scott","tiger");
String st="select * from emp";
PreparedStatement ps=conn.prepareStatement(st);
ResultSet rs=ps.executeQuery();
while(rs.next())
{
String s1=rs.getString(1);
String s2=rs.getString(2);
String s3=rs.getString(3);
System.out.println(s1+" "+s2+" "+s3);
}
conn.close();
}
}
/*here 192.168.0.13 is the ip-address of the machine where oracle server is installed. If your system is a stand-alone one the instead of ip-address you can give "localhost" or loop-back address "127.0.0.1", and "1521" is the default port number of connecting oracle with java..*/
0
0
- What Is The Oldest Database Model?
- What Is The Oldest And Simplest Of The 5 Database Models?
- What Does The Term Data Independence Mean And Why Is It An Important Goal?
- What Is 2-tier Architecture Of Database?
- You Are Writing A Database Application To Run On Your DBMS. You Do Not Want Your Users To Be Able To View The Underlying Table Structures. At The Same Time You Want To Allow Certain Update Operations?
- What Is The Role Of A Data Entry Administrator?
- How Dbms Provides Concurrency?
- What Is A Paper Based System?
- What Are The Benefits Of Using Database Approach?
- How Do You Feel About Database?
- How Do I Get A Sponcership For A Model?
- Explain Disadvantages Of Normalization With Examples?
- Explain Thomas Write Rule In Sql & Database?
- Show How The Efficiency And Integrity Of The Data Is Maintained At All Times Although Database Is Used By Persons At Varying Organizational Levels In Management Information Systems?
- What Does Table Of Contents Mean?
- What Is The Objective Of Database?
- What Are The Characteristics Of A File?
- Conduct A Search Through The Opposing Viewpoints Resource Center Database In The University Library.From The List Of Popular Searches, Select Two Topics That Spark Your Interest. Review The Available Materials For Each Topic?
- Which Numbering System Do Accrediting And Regulatory Agencies Recommend?
- How Do I Add A Column To A Table In Word 97?
- What Is A Disadvantage Of Using A Paper-based Database?
- What Is Code Of Integrity?
- How The Efficiency And Integrity Of The Data Is Maintained At All?
- What Is File-based Approach?
- How Do I Create An SQL Queries That Show: Student Name, Address, And Contact Information For All Students? Student Name And The Certificate Program For Which They Are Registered Student Name And The Courses For Which They Are Registered?
- Where Will The Database Connection Will Be Stored ?
- How Is Create Database Connection In Vb
- How To Give A Database Connection In Asp Using ODBC?
- What Happens To My ISDN Connection/fax Machine/ Burglar Alarm When I Get A Broadband Connection?
- What Is Database.describe Advantages And Disadvantages Of Using Database?
- What Is The Difference Between The Connection Oriented And The Connection-less Service?
- What Would Establish A Monopoly?
- How Do I Establish ? What Is The Requirements?
- How Do You Establish Credibility?
- What Is The Synonym For Establish?
- Why Establish The Needs And Wants Of Customers?

New Comment - Comments are editable for 5 min.