i can connect sql server through a .java file. i mean to say if i will write jdbc code in a .java file compile it and run it from dos/command prompt, it connects database very fine but as soon as i use same code in
servlet (although it's too a .java file), it gives me exception that data source name not found. the code is as follows. if you can help me i am very thankful to you as i have already spent much time on it. Please
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
}catch (Exception e) {
System.out.println("Error in Initialising Drivers -> "+e) ;
}
try {
con = DriverManager.getConnection("jdbc
dbc:;DRIVER=SQL SERVER;SERVER=mysqlserver;DATABASE=mydatabase","sa","") ;
}catch (Exception e) {
System.out.println("Unable to establish connnection with the database : Reason\n" + e.getMessage()) ;
}
try {
s = con.createStatement() ;
}catch (Exception e) {
System.out.println("Unable to create statement : " + e) ;
}
------------------