Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Based on the example program given (Java based, MySQL): a) Write/modify a java code that can return all rows that are Pathogenic (hint: CLNSIG=Pathogenic) b)

Based on the example program given (Java based, MySQL):

a) Write/modify a java code that can return all rows that are Pathogenic (hint: CLNSIG=Pathogenic)

b) Of the genes that are Pathogenic, what is the frequency? This is a histogram of gene symbol to number of occurrences.

image text in transcribed

image text in transcribed

package mysql_app: import java.sql.Connection; import java.sql.Driver import java.sql.DriverManager; import java.sql. SQLException; import java.sql.Statement; import java.sql.Resultset; public class MySQL App public static void main(String args) Connection connnull; //we are assuming you have a MySQL server runing and have made a user account for /365 user with the password $SPRING_2018 with full privileges string url = "?dbc: mysql://localhost: 3306/cs365?autoreconnectstrue&useSSLe false". String uid"365 uSe String pwd = "$.SPRING-2018 S". tryt Class.forName("om nysg.idbs.Driver").newInstance) conn DriverManager.getConnection(url, uid, pwd); if (conn!null System.out.print("connection establishedn") ) catch(Exception ex) Systen.out.print (ex); Statement stmt null; ResultSet = null; tryt stnt conn.createStatement); TA= stnt.executeQuery("SELECT * FROM test.. }; or alternatively, if you don't know ahead of tine that // the query will be a SELECT.. f (stmt.execute("SELECT FROM test")) rs-stmt.getResultSet() while s.next))i / Now do sonething with the Resultset catch (SQLException ex) // handle any errors Systenout println("SQLException:" ex.getMessage)); Systen.out println"SQLState: "ex.getsQLState)) Systen.out.println("VendorError: " + ex.getErrorCode()) finally // it is a good idea to release / resources in a finally block / in reverse-order of their creation / if they are no-longer needed if (rs, != null) { try > catch (SQLException sqlEx) rsnull; rs.lose) /I ignore package mysql_app: import java.sql.Connection; import java.sql.Driver import java.sql.DriverManager; import java.sql. SQLException; import java.sql.Statement; import java.sql.Resultset; public class MySQL App public static void main(String args) Connection connnull; //we are assuming you have a MySQL server runing and have made a user account for /365 user with the password $SPRING_2018 with full privileges string url = "?dbc: mysql://localhost: 3306/cs365?autoreconnectstrue&useSSLe false". String uid"365 uSe String pwd = "$.SPRING-2018 S". tryt Class.forName("om nysg.idbs.Driver").newInstance) conn DriverManager.getConnection(url, uid, pwd); if (conn!null System.out.print("connection establishedn") ) catch(Exception ex) Systen.out.print (ex); Statement stmt null; ResultSet = null; tryt stnt conn.createStatement); TA= stnt.executeQuery("SELECT * FROM test.. }; or alternatively, if you don't know ahead of tine that // the query will be a SELECT.. f (stmt.execute("SELECT FROM test")) rs-stmt.getResultSet() while s.next))i / Now do sonething with the Resultset catch (SQLException ex) // handle any errors Systenout println("SQLException:" ex.getMessage)); Systen.out println"SQLState: "ex.getsQLState)) Systen.out.println("VendorError: " + ex.getErrorCode()) finally // it is a good idea to release / resources in a finally block / in reverse-order of their creation / if they are no-longer needed if (rs, != null) { try > catch (SQLException sqlEx) rsnull; rs.lose) /I ignore

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions