• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connection Class

 
Greenhorn
Posts: 24
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Respect Sir,

While using Netbeans 12 for Java, I have may forms.
I have to use following codes in every form



What I want to create a class for connection and call that class in every Jframe forms

So I used this method

https://imgur.com/a/WjaS4Hk

I created a class named get_connection.java

this class has following codes




Above codes work fine, db is connected.

But how to call this class in other Jframe forms?

Regards
 
Rancher
Posts: 5008
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also posted here: https://www.dreamincode.net/forums/topic/420563-one-connection-class-for-all-jframe-forms/page__gopid__2428166&#entry2428166

Please read:  https://coderanch.com/wiki/660346/Wiki/Forthright-Cross-Posting-Sites

Also you should tell the other forum that the other problem you posted there (and here) has been solved.
https://coderanch.com/t/737683/databases/java-lang-ClassNotFoundException-microsoft-sqlserver
 
Tariqq Mehmoodd
Greenhorn
Posts: 24
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK Sir I shall care next time.

Regards
 
Norm Radder
Rancher
Posts: 5008
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I shall care next time.


It is not too late to do it now.

There are people trying to help on the other forum that should know that this question is posted here also.
 
A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic