• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver spe

 
Samuel Jaeson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am Trying to connect SQL Database using JDBC
till yesterday it was working fine today
i installed some java based ide like netbeans and eclipse
then it started giving this error
net beans which i used used to take port 8084 but my Apache port is set to 8080 port and many a time changes made in the servlets did not reflect
probably it used to pick up prevously runned servlet
now i have uninstalled all the ide but still its giving me the same error
i have created ODBC Driver and its working fine
i dont know may be there is some conflict with config setting or my code is wrong
kindly guide me
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
here is my code
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc dbc nlineBankingSQL","sa","sumitj");
out.println("ConnectionCreated");
Statement stmt = con.createStatement();
rs = stmt.executeQuery("Select Accid, Sum(TAmt*TType) Balance from Trans where AccId= '"+accidparam+"' group by Accid");
rs.next();
Balance = rs.getString("Balance");
}
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might copy whatever is inside of your Class.forName and put it in your imports. Then it won't compile if you're missing that. But when you mess around with ODBC, you need to define a datasource in Windows. Could that have changed?

--Dale--
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic