I have to make a database in oracle and connect it with Java. But I'm not able to do so.
Please help.
I want to make a space ship and fly back to my home on Mars, please help me too.
stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154
@coolbuddy059 please provide your current code so we may have look at it and correct it if there is any issue
PS:In the future please provide more info, if you wish to avoid general suggestions such as one by stephen. Secondly we have rule that says " We only give homework help to those who show effort "
peter_budo
Code tags enforcer
15,433 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 901
As error message states you missing closing bracket "}" on the end of your code. If you check your code you will find that main() was closed, however you did not do same for the class
peter_budo
Code tags enforcer
15,433 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 901
Peter has already mentioned the cause of your problem, now just wanted to add a few notable things like :-You never closed your connection, Its important to close your database connection once you are done using it. Preferably put the call to close() inside a finally block, so that your database connection is closed irrespective of whether an SQLException was thrown during your query execution etc.
In the catch block where you have caught your SQLException always print / log the SQL State by calling e.getSQLState(), by comparing the SQL State with your DBMS vendor data example here , you can map out exactly why your query failed.
stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154