hi, to all i was thinking how i can create a class that the connection string will be stored there.

now i have 4 files the teamSystem.java, login.java, and main.java, and connect.java.
the connection string should be written on the connection.java, now i want that other 3 files should communicate with the connect.java what i mean is that i will not write the code anymore in the other 3 files something look like the include statement code for jsp but i dont know how to use it in java application.

i will appreciate for any help.
i am sorry for my bad english.

thank you

Recommended Answers

All 2 Replies

Are you asking how to define global constants in one class that can be used in other classes?
Define a class with variables:
class TheGlobals {
final static public <type> <name> = ....
}

To use a variable: TheGlobals.<name>

Thank you for the help, it is working now.
thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.