Results 1 to 1 of 1
- 09-28-2007, 12:59 PM #1
How to Execute SQL statements in Spring Framework
The following code is a simple example of executing the SQL statements in Spring framework.
Java Code:import javax.sql.DataSource; import org.springframework.jdbc.core.JdbcTemplate; public class ExecuteAStatement { private JdbcTemplate jt; private DataSource dataSource; public void executestmt() { jt = new JdbcTemplate(dataSource); jt.execute("create table person (id integer, name varchar(100))"); } public void setDataSource(DataSource dataSource) { this.dataSource = dataSource; } }
Similar Threads
-
how to learn spring framework
By m16k2002 in forum Web FrameworksReplies: 6Last Post: 04-06-2009, 02:14 PM -
How to run Queries in Spring framework
By Java Tip in forum Java TipReplies: 0Last Post: 04-01-2008, 10:42 AM -
How to Execute SQL statements in Spring Framework
By Java Tip in forum Java TipReplies: 0Last Post: 04-01-2008, 10:41 AM -
What is use of NamedParameterJdbcTemplate in Spring Framework
By Java Tip in forum Java TipReplies: 0Last Post: 04-01-2008, 10:39 AM -
What is weaving in Spring Framework
By Java Tip in forum Java TipReplies: 0Last Post: 03-29-2008, 12:39 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks