- This topic has 7 replies, 2 voices, and was last updated 13 years, 8 months ago by support-swapna.
-
AuthorPosts
-
Alejandro BarreroParticipantI know this is not a J2EE question, but I could not find an appropriate forum. The code is:
public static void main(String[] args) { try { DataSource dataSource = new AccessDataSource( "D:\MyWorkspaces\Eclipse\The Paperless Office\PaperlessOffice.database", 1); Connection conn = dataSource.getConnection(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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"); }
I have in both the same Java compliance, 1.6, and the same jre “C:\Program Files (x86)\Java\jdk1.6.0_20”.
Alejandro BarreroParticipantSorry. I found that the code that runs in Eclipse is in another project. The code in the same project also fails. I DON’T KNOW HOW TO DELETE THIS POST.
Alejandro BarreroParticipantI need this post to go on. The actual problem is that in MyEclipse, the code runs well in one workspace but fails in another.
support-swapnaModeratorhandro1104,
Can you please answer some questions for me to understand the issue?
1) Please share your installation details from MyEclipse > Installation Summary > Installation Details. Paste them here for me.
2) What is the error you see in the workspace in which the code is not working. Clear the error log which is located at < workspace dir>/.metadata/.log . Now switch to the workspace where your code is not working. Run it and check the .log file for any errors of interest. Paste them here for me.
Alejandro BarreroParticipantThank you again for your support. I actually realized that the problem is with Eclipse because the problem also occurs with the same workspace. On the other hand, I solved the problem by by copying the code to a new workspace (haven’t tried with a new project in the same workspace.).
support-swapnaModeratorhandro1104,
Glad that it is working fine.
Do let us know if you have any other issues.
Alejandro BarreroParticipantHi swapna. I hope you remember my problem creating web applications with only a servlet.
support-swapnaModeratorhandro1104,
Please refer to it here :
https://www.genuitec.com/forums/topic/problem-with-web-applications/#post-315134 -
AuthorPosts