No. I want to create e GUI, which has a 'START SEVER' & 'STOP SERVER'. when i click my 'SART SERVER BUTTON', it must start a normal Java server & connect to a database i created with SQL2000. Any IDEAS PLEASE?
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
Uh, then just use the button component provided by the UI framework you're using and let it invoke Runtime#exec() accordingly.
Thabo Matjuda
Greenhorn
Joined: Jul 06, 2008
Posts: 29
posted
0
Thanks Man. I wil look into it, ryt nw its 4am where i stay. My eyes are painful together with Fingers too. Thanks, i wil cme again when I get stuck.
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
I recommend you to do it step by step (in OO way).
Create a class with methods which starts and stops the server and test it as plain Java Application with main().
Once you got that work, you just have to let the button use this class and invoke the method accordingly.
Satya Maheshwari
Ranch Hand
Joined: Jan 01, 2007
Posts: 368
posted
0
Runtime.exec is a good idea but may compromise the portability of the application. Is there a java way to start the server i.e. can the server be started by running a class in JVM.
Thanks and Regards
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32654
4
posted
0
Thabo Matjuda wrote:Thanks Man. I wil look into it, ryt nw its 4am where i stay. My eyes are painful together with Fingers too. Thanks, i wil cme again when I get stuck.
Read this FAQ. Your sore fingers are causing trouble for other readers, I am afraid.
Satya Maheshwari wrote:Runtime.exec is a good idea but may compromise the portability of the application. Is there a java way to start the server i.e. can the server be started by running a class in JVM.
Needing to run SQL Server as part of the application has already compromised the portability of the application; its Windows only. Which makes me wonder why you would use Java to control SQL Server at all? SQL Server runs as a service which will run at startup by default. Why not just trust the database will be running? Or even better, why not host the database on a server and manage it yourself using the out the box tools?
Wow. Thanks being greenhorn suck. Well this server i am talking about is just a different server in netbeans jst so it may accept multiple clients. The only thing i am doing with sql is just my java application(my own server) must b able to connect to an sql database
"a different server in netbeans"? not sure what you mean here. NetBeans is an IDE, it doesn't manage databases. Presumably the server itself is running somewhere and you use NetBeans to connect to it?
If all you need to do is connect to the (already running) server that is just basic JDBC. The JDBC tutorial and our own JDBC FAQs are good places to get an understanding of how to do that.
Thabo Matjuda
Greenhorn
Joined: Jul 06, 2008
Posts: 29
posted
0
Gee i suck at English too. Okay let me try being clearer. Okay in Netbeans you can create a Client/Server application right? Now in my 3Days Project. I must create a client server application, obviously for my client to retrieve eg...A list of music artists from SQL It must ask my server side. So now that same Java/Server App i created must connect to a an SQL database in order to serve a Client. Now i am ok with The Basic JDBC. May be i should give you a bit of My Summarized Project Specifications which is wantd in 3Days from tomorrow...How about that? Highly appreciated only if you have time to just reply and help me here and there, i am willing and ready to hear out a more experienced Java Programmer.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.