| Author |
jdbc with mssql noob issue
|
thejwal pavithran
Ranch Hand
Joined: Feb 11, 2012
Posts: 113
|
|
hey guys the line st.executeUpdate(table); seems to take control to the catch block..i am new to try catch too...what is my mistake please guide me
|
on job hunt
|
 |
Sumit Patil
Ranch Hand
Joined: May 25, 2009
Posts: 296
|
|
Can you post the error message you are getting?
Also, try putting a catch block with SQLException before the catch block you have given.
|
Thanks & Regards, Sumeet
SCJP 1.4, SCWCD 5, LinkedIn Profile
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12907
|
|
Please change this part of your code:
Into something more useful:
So that at least you have a clue about what goes wrong - just the word "error" isn't going to tell you very much.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
thejwal pavithran
Ranch Hand
Joined: Feb 11, 2012
Posts: 113
|
|
|
Sorry for completely editing this post I had pasted the wrong code here.hey the e.stacktrace() pointed out the error. it says that the table already exists..so the problem occurs when i try to create the same table again right?
|
 |
thejwal pavithran
Ranch Hand
Joined: Feb 11, 2012
Posts: 113
|
|
|
Thank you jesper your advice worked.
|
 |
Nam Ha Minh
Ranch Hand
Joined: Oct 31, 2011
Posts: 346
|
|
thejwal pavithran wrote:Sorry for completely editing this post I had pasted the wrong code here.hey the e.stacktrace() pointed out the error. it says that the table already exists..so the problem occurs when i try to create the same table again right?
You should use:
DROP TABLE IF EXISTS
or
CREATE TABLE IF NOT EXISTS
|
Hiring Java developers
|
 |
thejwal pavithran
Ranch Hand
Joined: Feb 11, 2012
Posts: 113
|
|
Nam Ha Minh wrote:
thejwal pavithran wrote:Sorry for completely editing this post I had pasted the wrong code here.hey the e.stacktrace() pointed out the error. it says that the table already exists..so the problem occurs when i try to create the same table again right?
You should use:
DROP TABLE IF EXISTS
or
CREATE TABLE IF NOT EXISTS
yes i will try that soon..thanks for your point
|
 |
 |
|
|
subject: jdbc with mssql noob issue
|
|
|