How can I test database access methods in Java?
Posted
by
javaStudent
on Programmers
See other posts from Programmers
or by javaStudent
Published on 2012-11-16T17:59:59Z
Indexed on
2012/11/16
23:16 UTC
Read the original article
Hit count: 270
I want to write a test for a method that accesses a database such as following.
public class MyClass{
public String getAddress(Int id){
String query = "Select * from Address where id="+id;
//some additional statements
resultSet = statement.executeQuery();
return result.getString(ADDRESS);
}
}
How can I test this method? I am using Java.
© Programmers or respective owner