Script « SQL « Java Database Q&A





1. Should I make Linux Shell Script or Java program?    stackoverflow.com

I need to generate multiple databases to SQL, so I need script/program to automatically generate those to SQL and generate files to jboss server. Our client server is running in Linux, ...

2. How to execute .sql script file using JDBC    stackoverflow.com

I have an SQL script file which contains 40-50 SQL statements. Is it possible to run this script file using JDBC?

3. Ant build script executing task using java code    stackoverflow.com

Any idea, why none of the debugging comments are printed once after executing the ANT build script's SQL task via java code? The java class to execute the sql in build scirpt ...

4. Making Java String usable for a SQL Script    stackoverflow.com

If I have a string that looks like this:

This is a string
with single quotes ' all over
the ' place as well as
return characters
How would I convert this to a string that ...

5. Running Sql script file through Java!    stackoverflow.com

In order to execute a whole Sql script file[which includes create table statements and some rules defining create table]. I found this solution in order to achieve it --->"There is great ...

6. Execute SQL script on deploy    stackoverflow.com

i need to execute little sql script(insert some data) after deploying JavaEE/JPA(eclipseLink) project too glassFish - what do you thing would be the best way to do that. I know that ...

7. How to find the time taken by an SQL script to execute completely using java code?    stackoverflow.com

I am trying to get the time taken by an SQL script to excute completely using java code.I am having jdbc connection code with me.but i do not have logic to ...

8. java ,sqlldr and shell script use for 10 million data    stackoverflow.com

I want to upload 10 million data to oracle DB from a file which is in FTP.I am using a Java +shell script+SQLLDR combination in following way--

  1. upload the 10 million data ...





10. running sql script file from java    coderanch.com

No sql script does not run on command prompt. We can run this in sql editor or some sql tool like Toad. syntax is like this @myscript Where myscript.sql is a file which contains some sqls. Like we can execute sql queries and stored procedures from Java, can we run these scripts file also. I think my question would be more ...

12. Need a SQL script for migration    coderanch.com

how about awk? awk -F, '{print "insert into table_a (C1, C20) values (\"" $1 "\", \"" $2 "\"")' csv-file then pipe result into isql or somesuch. just nosy, but why are they dictating what tool(s) you can use? what's wrong with letting you get the job done the best way you know how?

15. can i execute sql script directly by java?    coderanch.com

Hi All, I also wanted to execute an sql script through java but had one more requirement. I wanted to ensure that the password that i am using to connect to the database as well as the arguments to the script are not visible through ps commands. Can you suggest me a way in which i can redirect the password as ...

16. Executing sql script at JBoss startup    coderanch.com





17. try to run sql script    coderanch.com

public class RealTimeMap2 { public static void main(String argv[]) { try { System.out.println("going to process"); String username = "root"; String password = "root"; String database = "test_db"; //Successfully executed String[] executeCmd = new String[]{"mysql","test_db","--user=root","--password=root","-e"," source d:/test_query.sql" }; Runtime.getRuntime().exec(executeCmd); // but if i want to pass this way with user varible its not process that file, nor throwing any runtime exception //String ...

18. Problems with .sql(script files) and .properties files. [Using Netbeans]    coderanch.com

Problem 1 I was told to create a Simpledatasource class to connect to the database and this class makes use of a configuration file called database.properties which stores information about the url, username and so forth in a simple text file consisting of key/value pairs such as: jdbc.url=jdbc:mysql://localhost:3306/university This was my code. As from horstmann's Big java. package laboratory2; import java.util.*; ...

19. Using SQL Script in JDBC    dbforums.com

20. Execute sql script from java    java-forums.org

Hello, I want to run an sql script generated by mysql inside java.This sql script creates the default tables.The first problem is that i had to remove the comments before executing the script.But then when i execute the script inside java i am getting errors.I am getting the same errors when i copy paste the script to mysql query browser!But if ...

21. execute a sql script    forums.oracle.com