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;

conn = DriverManager.getConnection("jdbc:jtds:sqlserver://ADVENT/DNS;user=mark;password=mark;namedPipe=true");
System.out.println("Successfully connected");
catch(Exception e){
System.err.println("Unable to connect");


Though I can search a lot of this code around the net most of it won't work. I've tried it. The one piece missing on their code is this:


Without it no matter how many times I tried to connect it will always refuse.

I used to hate curly braces but now things are getting better for me.


Nonna said…
good! keep up the good work :D
maks said…
:D your welcome. mwah love you

Popular posts from this blog

John Gokongwei Speech before Ateneo 2004 Graduates

High Grounds Cafe - Best Internet Cafe in the Philippines

SM Mall of Asia