Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Executing Set of SQL statements in Java
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Manjunath
Executing Set of SQL statements in Java
1 Answer(s)      3 years and 5 months ago
Posted in : Java Beginners


Hi,

I am trying to execute a procedure which is stored in MS SQL server's database. I have configured the driver with ther server name, database name and uid/pwd using a callable statement. Then i am stor

Connection conn=null; CallableStatement cstmt=null; try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); conn=DriverManager.getConnection("jdbc:odbc:drivername", "uid", "pwd"); cstmt=conn.prepareCall("{proc_name}"); ResultSet rs= cstmt.executeQuery();

The procedure has drop temp table statements, select multiple values from tables with different conditions, storing in a temp table, select values from the temp table again and storing them in an excel. I have created the code for saving the data in excel but the code for executing the query is not working. Please help.


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Executing Set of SQL statements in Java
Executing Set of SQL statements in Java  Hi, I am trying to execute a procedure which is stored in MS SQL server's database. I have configured...= cstmt.executeQuery(); The procedure has drop temp table statements, select multiple
executing multiple sql statements on the single button click...
executing multiple sql statements on the single button click...  how can i frame a code on the click of a button to insert data into a table as well as to retrieve records from the same table in another form
Advertisements
executing multiple sql statements on the single button click...
executing multiple sql statements on the single button click...  how can i frame a code on the click of a button to insert data into a table as well as to retrieve records from the same table in another form
Executing anonymous pl/sql block and get resultset in Java
Executing anonymous pl/sql block and get resultset in Java  Hello All, I would like to execute the anonymous pl sql block and need to get the resultset object. I got the code which can be done by using cursors inside the pl sql
netbeans ddl and dml sql statements - Java Beginners
netbeans ddl and dml sql statements  Kindly send me the ddl,dml and tcl commands while in netbeans. wilson
The INSERT INTO Statements in SQL?
The INSERT INTO Statements in SQL?  The INSERT INTO Statements in SQL?   Hi, The INSERT INTO statement is used to insert a new row or multiple rows into a table. SQL INSERT INTO Syntax INSERT INTO table_name VALUES
What is the Delete Statements in SQL?
What is the Delete Statements in SQL?  What is the Delete Statements in SQL?   Hi, Here is the answer, Delete statement in SQL is used to delete partial/all data. Especially delete statement is useful in case
while executing a java program
while executing a java program  while iam executing a simple java program after i type "java simple.java" there was a an error occuring.the error is "exception in thread "main" java.lang.noclassdeffounderror:simple" what thus
Hibernate generated SQL statements on console
Hibernate generated SQL statements on console  If you want to see the Hibernate generated SQL statements on console, what should we do?   If you want to see the Hibernate generated SQL statements on console just add
Java statements
Java statements   What is the difference between a break statement and a continue statement
Java statements
Java statements  What is the difference between a break statement and a continue statement
java statements
java statements  What is the difference between an if statement and a switch statement
Java statements
Java statements  What if there is a break or return statement in try block followed by finally block
executing java program with 2 classes
executing java program with 2 classes  how to run a program of java containing more than one class....ex of program is given below.... class C...); } }   Executing java program with 2 classes save the file with D.java
Show Hibernate generated SQL statements on console
Show Hibernate generated SQL statements on console  How can i see Hibernate generated SQL statements on console?   In Hibernate configuration file add the following: <property name="show_sql">true</property>
creating jdbc sql statements - JDBC
creating jdbc sql statements  I had written the following program and when i compile it it is giving some errors...can u give the reason.. Actually i had created table in MS Access by giving name as jdbcsecond and dsn name
Why we use Semicolon after SQL Statements?
Why we use Semicolon after SQL Statements?  Why we use Semicolon after SQL Statements?   Hi, Some database systems require a semicolon at the end of each SQL statement.The semicolon character is a statement
Understanding Common SQL statements
Understanding Common SQL statements       The commonly used SQL statements are: 1... SQL Select statement: The SELECT statement is used to select data from
Flex Looping
.style1 { border-style: solid; border-width: 1px; background-color: #FFFFCC; } Executing a set of statements repeatedly is performed through looping. For this purpose, Flex provides some looping mechanism like: 1
MySQL Transactional and Locking Statements
by statements like START TRANSACTION, SET AUTOCOMMIT, COMMIT and ROLLBACK. Transaction means a group of SQL Statements, which executes as a unit. And MySQL either... MySQL Transactional and Locking Statements  
java programe executing error - Java Beginners
java programe executing error  i am creating one package to one class... Friend, If you have following java class: package newp; class Hello...!"); } } Compile as: javac -d Hello.java Execute it: java Hello
Avoiding â??!= nullâ?? statements in Java?
Avoiding ‚??!= null‚?? statements in Java?  Avoiding ‚??!= null‚?? statements in Java
Looping Statements in java 7
Looping Statements in java 7 In this section, we will discuss about Looping Statements in java 7. This is one type of control flow statement. Looping Statements : This kind of statements are used where you need to execute block
java program using control statements...
java program using control statements...  public class ControlStatements { public static void main(String args[]){ int x=10; if(x==0){ System.out.println("It is zero"); else if(x>0) System.out.println
Statements in JDBC - Java Interview Questions
Statements in JDBC  Hi, Explain statement, preparedstatement, callable statement. which is best and why. when to use preparedstatement. plz dont give link . explain ur words with example
java conrolling statements - Java Beginners
java conrolling statements  write a Java program to accept 10 integers and print the sum of numbers divisible by 5
Problem in executing macro enabled excel sheet using java
Problem in executing macro enabled excel sheet using java  Hi, I have written a java code which will read a excel sheet with macro enabled. then it will write data into sheet1 and sheet2 and it will execute a VB script
Control Flow Statements in java 7
Control Flow Statements in java 7 In this section we will discuss Control Flow Statements in java 7. This is one type of Language Fundamentals. Control Flow Statements : - In general program execution flow is from top to bottom
Branching Statements in java 7
Branching Statements in java 7 In this section, we will discuss about Branching Statements in java 7. This is one type of control flow statement. Branching Statements : Branching statements are categorize in the following types
Expressions, Statements, and Blocks in java 7
In this section we will discuss expressions, Statements and Blocks in java 7. This is one type of Language Fundamentals
Java Control Statements
Java Control Statements      ... if The if statement: To start with controlling statements in Java, lets have a recap over... in Java.    Loop Statements while
 

 

 

DMCA.com