File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Driver

 
shruti patel
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In real type application which type of driver we use to connect to oracle
Database?
 
Sidharth Pallai
Ranch Hand
Posts: 134
Hibernate Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Type4 would be the best option using thin-oracle driver URL
 
vijay jamadade
Ranch Hand
Posts: 243
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
shruti patel
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks .
can you give the URL Path for connecting to the sybase and oracle database
connection.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
vijay jamadade
Ranch Hand
Posts: 243
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2577
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can help if you print the exception information, in stead of a fixed error messageRegards, Jan
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic