• 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
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Running .sql File in java

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I have to run a a ".sql" file through java. Can anyone tell how it can be done.
Regards
Amit Lonkar
 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i guess ".sql" file you are talking contains set of sql statements. Hence you can write the stored procedure in the back end and execute the same using java.
-arun
 
Amit Lonkar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am using Mysql. So stored procedures might not be possible.
One way i found out is, I need the command
mysql --execute="c:/test.sql" to be execute. I put this in a batch file, and ran the batch file using Runtime class.
Reagrds
Amit Lonkar
 
reply
    Bookmark Topic Watch Topic
  • New Topic