I am having some difficulty while trying to connect to my Open Office Database using JDBC connections. I dont know where i am committing mistake,it will be great if you could provide me suggestions or modify my code which is pasted below. I want to access the database to perform some further operations:-
I havent got much exposure about the JDBC connections before so it will be nice if you can take a look if i have committed some errors in any of the statements in the above code snippets. Please provide me any refernce code snippets also if you have any for Open office JDBC connectivity...
I will be looking for your reply on this
P.S : The database is Open Office database with the table named student created in it.
First of all thank you for all your reply and suggestions in this regard. I tried to implement the driver class as shown below in my code but it doesn't seem to work. My code still doesn't respond and also doesn't connect to the Open office Database. I will brief out a bit about my requirement .
I want to connect to the Open office database and fetch the datafrom the Openoffice database table named employee and populate it in my excel sheet. But in this process i am failing in the first step itself ,that is connection to the Open Office database.Could you please take a look on the code which i have pasted below because i have made many attempts to figure out the exact issue but I am not able to get it resolved.
It's quite likely (and in your case almost certain) that the code will throw some kind of exception. And you have written your program to say "If the code throws an exception, don't do anything".
This is a bad idea. If an exception is thrown, you want to know all about it. So print its stack trace when it happens:
posted 6 years ago
Thank you!for the suggestions.I tried implementing what you have suggested and got the below errors in my java console.I am unable to make out the very reasons behind these errors ,the first one says File input/output error but my file path for the database file is correct. it is the same location c:\mydbdir\test.properties .It will be great if you could provide me your suggestions on the below errors I am getting with reference to execution of my code which i have pasted before in my previous post reply.
ERROR I GOT IN CONSOLE
java.sql.SQLException: File input/output error: file:c:\mydbdir\test.properties
posted 6 years ago
You are facing problem in creating excel file.
Check line number 21