In selenium testing how to connect with database , any one
pls give the entire information
Answers were Sorted based on User's Feedback
Answer / guest
Just create a java class for jdbc connection, call it when
you need to connect to database. to crate a jdbc connection
class please follow
http://www.roseindia.net/jdbc/jdbc-mysql/MysqlConnect.shtml
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sandip
public class dbconnection
{
public static void main(String args[])
{
String email;
String dbUrl = "jdbc:mysql://localhost:3306/test"; //This
URL is based on your IP address
String username="username"; //Default username is root
String password="password"; //Default password is root
String dbClass = "com.mysql.jdbc.Driver";
String query = "Select email from users where user_id = 1;";
try
{
Class.forName(dbClass);
Connection con = DriverManager.getConnection
(dbUrl,username,password);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
while (rs.next())
{
dbtime = rs.getString(1);
System.out.println(email);
} //end while
con.close();
} //end try
catch(ClassNotFoundException e)
{
e.printStackTrace();
}
catch(SQLException e)
{
e.printStackTrace();
}
} //end main
} //end class
| Is This Answer Correct ? | 2 Yes | 0 No |
Could someone educate me on automation testing process followed in a company. I have a vague idea, but i need concrete answers. And thank you all in advance.
How will you choose a tool for test automation?
What is the purpose of the wrun.ini file?
How to write output data to a file (txt,csv,excel) using Test complete automation tool?
hi i would like to know is there any training institue for Calabash,robotium and ui automator in hyderabad...urgent
what is the difference between winrunner,loadrunner,qtp,silktest,rational robo?
What is use of writing Test cases
test cases test wheather window? test cases to test calculaor? test cases to test a reverse string program? test cases to test program{ int.parse(sting str) $return (int)}? test cases to test program{display string length}?
What are the frameworks available in rc?
What are the advantages of the automation framework?
Give some examples of priority – severity defect levels.
What is extreme programming and what has it got to do with testing?