File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc connection in main method

 
shivam aggarwal
Greenhorn
Posts: 8
  • 0
  • 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
  • 0
  • 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
Pie
Posts: 47228
52
  • 0
  • 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