aspose file tools*
The moose likes Linux / UNIX and the fly likes Connection to database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Connection to database" Watch "Connection to database" New topic
Author

Connection to database

Pranav Butala
Greenhorn

Joined: Jan 20, 2004
Posts: 27
Is there a way to write a bash script that will connect to MySQL database if all the JDBC connection information along with user id and password is provided?
driver=com.mysql.jdbc.Driver
url=jdbc.url
userid=jdbc.userid
password=jdbc.password
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
If you're accessing the database from a bash script, why not just use the mysql client program? IMO it's easier to call it directly, and then process the results in the shell program.
Pranav Butala
Greenhorn

Joined: Jan 20, 2004
Posts: 27
Cannot do it. Using ant script for deployment precess. Sql task in ant fails to execute the dump file properly. Need to call it through a shell script. Project guide lines.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection to database