• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc connection in main method

 
shivam aggarwal
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it mandatory to make jdbc connection in main method;i tried to use it in event handling method of a button and it gives no response and no errors
 
samir singha
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not at all. You should make a separate Connection class for JDBC. Did your code in event handling method includes any output statement??
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You ought not to have a connection in the main method. Use the main method to start the application and nothing else.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic