I have done a stand alone project on Java Swing and MySql where the frontend is designed by Swing and backend is designed on MySQL

I wanna build an exe of the project by incorporating the MySql schema and tablespace into the archieved file(exe/jar)

Plz tell me whether is it possible?
If it is possible then tell me how can I do this .

you can create jar for your project

you have to make manifest file

Manifest-Version: 1.0
Specification-Title: Java Utility Classes
Created-By: 1.5.0 (Sun Microsystems Inc.)
Main-Class: maninclassname

save it as manifest.mf keep this file in current project folder.

and go to project location then type in command prompt:

jar cmf manifest.mf anyname.jar *.*

press enter then you will get your jar file created.

If you want to create Exe means you have to go for third party tool.

If you want to create Exe means you have to go for third party tool.

Please Mention one third party tool

execJAVA currently am using this exe converter from jar file.

but its trial version only.

you can download this from www.JavaAPIs.com

anyway you have to convert your application in to jar format.

just Tried execJ but cannot include tablespace into the exe
The application is running from exe without any operation on database

nativeJ is an easy to use java-to-exe tool, but why would you want to make an exe of it,?

if you're intending to let other people use your program as well, I'd suggest you stick with the jar file.

nativeJ is an easy to use java-to-exe tool, but why would you want to make an exe of it,?

if you're intending to let other people use your program as well, I'd suggest you stick with the jar file.

Jar file is good for using the software , also batch file can also be created
by which we will run the jar file without trying into commandline
but the problem is what will be the databases and connectivity how can I import database schemas in the jar file which will be created .
and suppose I want to run/deploy the application in a machine where the mysql server is not present and also classpath is not present , so in that case database schema and tablespaces also should be packaged with jar file

How can I solve it out jar along with schema and connections

Read this arcticle "Convert Java to EXE" and you may find some answers

If you are talking about DB server installation through your executable jar, I won't recommend it. See, DB installation requires user interaction, which shall not be easiest of things to achieve.

If you ask your application users to at least install DB server and have a default user, rest I think is achievable.

Without much thinking I can think of following strategy to get this done:

  1. Have a properties file with DB credentials - username/password and table space related values which user wishes to create for new application installation. This properties file should also contain default username and password.
  2. You can have a batch file which will call up a java code which shall in turn read from this properties file, login into DB, create tablespace and user in client's DB.
  3. Next, you can have all DDL statements in a file, and same java code can execute this sql file to create your DB schema.
  4. Once this is done have another batch file to execute the actual application code, which shall execute your application.

This is a two step process, but I guess would be safer and faster to do. For the second step you can think of creating an exe.

For your concern on not having classpath or for that matter even JRE, please go through following link:
http://forum.java.sun.com/thread.jspa?threadID=780494&messageID=4441193

After this classpath won't be that big problem I guess.

anyone wanting to turn Java code into native Windows executables should be shot on sight.
It's useless.

If you are talking about DB server installation through your executable jar, I won't recommend it. See, DB installation requires user interaction, which shall not be easiest of things to achieve.

If you ask your application users to at least install DB server and have a default user, rest I think is achievable.

Without much thinking I can think of following strategy to get this done:

  1. Have a properties file with DB credentials - username/password and table space related values which user wishes to create for new application installation. This properties file should also contain default username and password.
  2. You can have a batch file which will call up a java code which shall in turn read from this properties file, login into DB, create tablespace and user in client's DB.
  3. Next, you can have all DDL statements in a file, and same java code can execute this sql file to create your DB schema.
  4. Once this is done have another batch file to execute the actual application code, which shall execute your application.

This is a two step process, but I guess would be safer and faster to do. For the second step you can think of creating an exe.

For your concern on not having classpath or for that matter even JRE, please go through following link:
http://forum.java.sun.com/thread.jspa?threadID=780494&messageID=4441193

After this classpath won't be that big problem I guess.

Nice suggestion bro I trying to do according you said

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.