aspose file tools*
The moose likes JDBC and the fly likes JDBC Driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Driver" Watch "JDBC Driver" New topic
Author

JDBC Driver

shruti patel
Ranch Hand

Joined: Mar 10, 2008
Posts: 52
Hi,
In real type application which type of driver we use to connect to oracle
Database?
Sidharth Pallai
Ranch Hand

Joined: Apr 21, 2008
Posts: 134

Type4 would be the best option using thin-oracle driver URL


Thanks & Regards
Sidharth Pallai
vijay jamadade
Ranch Hand

Joined: May 12, 2008
Posts: 241
hi,
yes type-4 is the only option you should use. becoz it is a pure java driver and as compared to the other drivers it has more benefits.


Regards, Vijay Jamadade.
( Nothing is Impossible.)
shruti patel
Ranch Hand

Joined: Mar 10, 2008
Posts: 52
Hi,
Thanks .
can you give the URL Path for connecting to the sybase and oracle database
connection.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Originally posted by shruti patel:
Hi,
Thanks .
can you give the URL Path for connecting to the sybase and oracle database
connection.


Not without knowing which drivers you are using.

The best place to find out that sort of detail is the documentation for Oracle and Sybase JDBC drivers.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
vijay jamadade
Ranch Hand

Joined: May 12, 2008
Posts: 241
hi,
I am providing a function to you. This is for oracle connectivity. Where necessary add your port number for the database server for oracle.

-----------------
public Connection getDbConnection(){
Connection conn = null;

try
{
/*oracle training databse connectivity */
Class.forName("oracle.jdbc.driver.OracleDriver");
conn =
DriverManager.getConnection("jdbcracle:thin:@server_ip:1521B_name", "username", "password");
}
catch (Exception e)
{
System.err.println ("Cannot connect to database server");
}
return conn;
}

----------------------------
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2500
    
    8

It can help if you print the exception information, in stead of a fixed error messageRegards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Driver