Posts

Showing posts from March, 2008

JDTS Database Connectivity

I finally manage to connect my Java program to MS SQL Server 2000 using JDBC JDTS after 11 hours of understanding how to connect and configure things. I guess that’s the beauty of OpenSource tools you have to dedicate most of your time in learning things but I am pretty much sure after this painful learning curve things will get smooth. Here is the Simple Code: import java.sql.*; public class NewApplication { public static void main(String[] args){ Connection conn; try{ Class.forName("net.sourceforge.jtds.jdbc.Driver"); conn = DriverManager.getConnection("jdbc:jtds:sqlserver://ADVENT/DNS;user=mark;password=mark;namedPipe=true"); System.out.println("Successfully connected"); conn.close(); } catch(Exception e){ System.err.println("Unable to connect"); e.printStackTrace(); System.exit(1); } } } Though I c...