• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBC That fails in one workspace but works in another

 
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this problem in Eclipse and MyEclipse. I create the connection with
public Connection getConnection() throws SQLException {
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String fullConnectionString = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="
+ filePath;
Connection conn = null;
try {
Class.forName(driver);
conn = DriverManager.getConnection(fullConnectionString, userName,
password);
} catch (ClassNotFoundException cnfe) {
throw new SQLException("ClassNotFoundException");
} catch (SQLException e) {
throw new SQLException("SQLException");
}
return conn;
}
} // Sorry, but using the code option was giving me problems
The exact problem is that I get the error "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"; for some reason JDBC is working different in the worspaces.
I am absolutely puzzled. The code stopped working in a workspace, but when I tried it in another workspace it worked.
 
Alejandro Barrero
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RESOLVED-SORT OF
I solved the problem by creating a project with the same code in a new workspace.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's good.

Also, I logged the code tag problem as a bug in our system. This shouldn't be happening!
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic