Saturday, 19 November 2016

Database Testing with Appium & JDBC

Appium is limited to testing your mobile applications. To use Appium for Database Testing you need to use the JDBC ("Java Database Connectivity").JDBC (Java Database Connectivity) is a SQL level API which allows you to execute SQL queries using java code . JDBC is used for enabling  connectivity between the Java Programming language and a wide range of databases. 

To test with database we need to learn how to connect with database first then how to execute queries followed by how to process the results.

Video Tutorial -

1. Connect to Database -

In order to make a connection to the database the syntax is as per given below and after connection setup you also need to load the JDBC Driver.

Connection con = DriverManager.getConnection(dbUrl,username,password);


  • Userid is the username configured in the database
  • Password of the configured user
  • URL is of format jdbc:< dbtype>://ipaddress:portnumber/db_name"

2.  Execute Queries -

Once connection is made, you need to execute queries.You can use the Statement Object to send queries. First Create Statement and once the statement object is created use the executeQuery method to execute the SQL queries.

Statement stmt = con.createStatement();

ResultSet rs=stmt.executeQuery(select * from employee); 


3. Process Results -

As in above example we have seen that after query execution the result is stored in  ResultSet Object. with this class object we can perform loads of actions to process an test the results as per our requirement.
  • String getString() - get the string type data from ResultSet.
  • int getInt() - get the integer type data from ResultSet.
  • double getDouble() - get the double type data from ResultSet.
  • Date getDate() - get the date type data from ResultSet.
  • boolean next() - move to next record in the ResultSet.
  • boolean previous() - move to previous record in the ResultSet.
  • boolean first() - move to first record in the ResultSet.
  • boolean last() - move to last record in the ResultSet.
  • boolean absolute(int rowNumber) - move to perticular record in the ResultSet.


  1. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

    1. IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.

      IEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.

      corporate training in chennai corporate training in chennai

      corporate training companies in india corporate training companies in india

      corporate training companies in chennai corporate training companies in chennai

      I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai

  2. This comment has been removed by the author.

  3. Your good knowledge and kindness in playing with all the pieces were
    very useful. I don’t know what I would have done if I had not
    encountered such a step like this.

    java training in chennai

    java Training in Bangalore

  4. I think this is the best article today. Thanks for taking your own time to discuss this topic, I feel happy about that curiosity has increased to learn more about this topic. Keep sharing your information regularly for my future reference.
    Java Courses in chennai

  5. Excellent blog! The content is so strong and informative.Thanks for sharing such useful post.
    Java training in Chennai

  6. This is an awesome post.Really very informative and creative contents.
    Wordpress Development company in Chennai

  7. TreasureBox is operated by a group of young, passionate, and ambitious people that are working diligently towards the same goal - make your every dollar count, as we believe you deserve something better.
    bike stand nz
    sofa bed nz
    gazebo nz

  8. I read this article, it is really informative one. Your way of writing and making things clear is very impressive. Thanking you for such an informative article.minecraft coding course