Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8373551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:42:13+00:00 2026-06-09T14:42:13+00:00

I am trying to set up a database test using Spring and DBUnit. I

  • 0

I am trying to set up a database test using Spring and DBUnit. I have a script to run before each test. The code below works but SimpleJdbcTemplate is deprecated. The method executeSqlScript is being moved to JdbcTestUtil as part of the 3.2 release but we’re on 3.1.x. What to use instead?

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class MyTestScript{

    @Autowired
    public DataSource dataSource;
    @Autowired
    public Resource script;

    @Before
    public void setup() {
        SimpleJdbcTestUtils.executeSqlScript(
            new SimpleJdbcTemplate(dataSource), script, true);
    }

    @Test
    public void testInsert() {
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:42:14+00:00Added an answer on June 9, 2026 at 2:42 pm

    You should just suppress the warning and go on. Once you switch to Spring 3.2, the transition will be trivial (remove all the Simple prefixes). There is no real reason to avoid SimpleJdbcTemplate at all costs in these tests, as its whole functionality is in JdbcTemplate under the same name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to execute a SQL script in my JUnit test using Spring.
I have a database set up with email and password, I'm trying to use
I'm trying to load up rails in the test environment using a ruby script.
I am trying to generate the below code via T4. using System; using MyDAL;
I have a Spring-Roo project set up using Eclipse link for my JPA persistence
I'm trying to run a load test on a testCase I have created in
I am trying to set the database name as the request input parameter from
This is my first time trying to set up a database. My intent is
I'm trying to set up a simple SQLite database in Android, handling the schema
I'm trying to set a value from the database into a Html component, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.