Posts

Connecting to SQL Server 2000 and SQL Server 2005 DB using JAVA

After 'Connecting to Multiple DBs using torque',now lets get Connected to Sql Server db. Why always connecting to DB? Won't we have any other better topics than this. We do, but you will probably have to wait for that. There is a reason why this topic is been chosen.Though connecting to MS SQL Server-2000 and SQL server2005 sounds same , but its not. And I even wont say that there are huge changes that we need to do for this. There are few things that we definitely need to be aware of before connecting to either of these DBs. a) We need three jar files to connect to Sql Server 2000.If I say 3 jars in this blog, then they are msutil.jar,mssqlserver.jar,msbase.jar. If we Use these three jar files, then the driver that we need to use is "com.microsoft.jdbc.sqlserver.SQLServerDriver" b) Instead of using the 3 jars, we can use only one jar, sqljdbc.jar , to connect to SQL server 2000 DB. Now we need to use "com.microsoft.sqlserver.jdbc.SQLServerDriver...

Connecting to multiple Databases using Torque

To begin with, let me say that ,  “Torque”  is an Object Relational Mapping(ORM) Tool for Java. I have some expertise working with Torque when compared to iBatis and  Hibernate, so  I thought of sharing one of my experiences that I came across when I WAS using Torque[yes, that’s right I am not using Torque anymore]. The requirement here was to connect to two databases, fetch data from one database and insert it into another.  Fetching and inserting into Databases is a very basic thing that I would like not to discuss here (at least in this blog). However, before we Fetch or Insert, there are few more operations that we need to perform, and one of those is “Establishing a Connection with the database”. This write-up with a small example data explains us the concept of connecting to multiple DBs using the ‘Torque’ ORM tool. torque.properties file appears to be like this ##  Oracle DB Properties torque.database=default torque.database.default.adapter=oracle...