Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI and batch file(.bat) any body please help ...  RSS feed

 
santosh vashist
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai all,
I am working with MySQL and i want to create an database programatically like how we create the tables.
So i have written a batch file in dos.
what i want to know is can i run this batch file through a java programm using JNI.
it would be greate if some body can solve this out.
thanks in advance,
saantosh
 
Roman Hoyenko
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can call batch file using exec method in java.lang.Runtime class.
If you want to use JNI to do this you can call batch file from C++ program.

 
Nura Horne
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
However a far more elegant solution rather than using a batch file would be to make a direct connection to the database using JDBC or, if you really want to use JNI the ODBC.
Rgds, A
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!