Hi I want to connect to my Microsoft SQL 7.0 database and Oracle9i database using Type 4 (Pure Java Driver).Could you please tell me what will be the JDBC URL for both the databases? Also I want to know whether I have to install any other thing apart from the respective databases. It will be very nice if you can post me the actual code for the conection. Regards Bamby
Cool Bamby Welcome to the Java Ranch, we hope you�ll enjoy visiting as a regular however, your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy. Thanks again and we hope to see you around the ranch!! For the JDBC URL question that is going to depend on the driver you are using for each database. The driver you installed should tell you what connection URL to use or what format it must be in.
1)Decide which Driver to be use : You could use the following : (a)For Oracle & SQL Server --> Merant SequeLink Server (Type 3) ; Data-Direct Connect for JDBC (Type 4) (b)For Oracle : Oracle Thin Driver (Type 4) 2) Once DataBase and Driver is decided, u need to know which Class to use and what url to connect to. (a) In Case you use Merant SequeLink Server : Class : com.merant.sequelink.jdbc.SequeLinkDriver URL : jdbc:sequelink://server:19996;user=userid;password=passwd;dataSourceName=SID (b) In Case you use Oracle Thin Driver : Class racle.jdbc.driver.OracleDriver URL :jdbc racle:thin:userid/password@server:1521 racleSID 3) Once you have above info, you can connect to the DataBase, using std code. String l_class = "oracle.jdbc.driver.OracleDriver"; String l_url = "jdbc racle:thin:userid/password@server:1521 racleSID"; Class.forName( l_class ) ; Connection conn = DriverManager.getConnection( l_url ) ;
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com