Database Connectivity to Mys

download Database Connectivity to Mys

of 7

Transcript of Database Connectivity to Mys

  • 8/12/2019 Database Connectivity to Mys

    1/7

    DATABASE CONNECTIVITY TO MYSQL

    1. How is database connectivity useful?Ans.2 How does Java application connect to a database? Name the technology only.Ans.3 Expand ODBC and JDBC.Ans.

    4 What is connection?

    Ans.5 What does a Statement Object do?Ans.

    6 What is result set?Ans.

    7 What for a Class.forName () used?Ans.

    8 Name two commonly used drivers used for database connectivity from Java applicatioAns.

    9 Name methods to do the following:(i) Open connection

    (ii) Create statement(iii) Move cursor forward by one row in a result set(iv) Place cursor to first row in a result set(v) Place cursor to last row in a result set.

    Ans.

    10 Which methods are used to execute SQL queries?Ans.

    11 Which package must be made part of Java application for database connectivity? Writstatement to do so.

    Ans.12 Write a statement to register driver com.mysql.jdbc.Driver with DriverManager.Ans.13 Write a statement to open a connection object namely myCon for a MySQL database n

    school.Ans.14 Name the methods for the following:

    (i) To fetch an integer value from a result set(ii) To fetch a float value from a result set(iii) To fetch a string value from a result set(iv) To fetch a date value from a result set

    (v) To fetch a boolean value from a result set(vi) To fetch a double value from a result set

    Ans.

  • 8/12/2019 Database Connectivity to Mys

    2/7

    15 What is the difference between following two statements that use an objectnamely rs of ResultSet type?(i) rs.getString(1);(ii) rs.getString (Name);

    Ans.

    MULTIPLE CHOICE QUESTIONS:

    1. We may use ____________ to develop the Front-End of an application.

    A. GUI B. DatabaseC. Table D. None of the above

    2. The ______________ method is used when we simply want to retrieve data from atable without modifying the contents of the table

    A. execute() B. queryexecute()C. query() D. executeQuery()

    3. Which of the following class libraries are essentially required for setting up aconnection with the database and retrieve data?

    A. DriverManager B. ConnectionC. Statement D. All of the above

    4. The _____________ is required to establish connectivity between the Java code andthe MySQL database.E. JDBC API F. JDBC DriverG. Both A and B

    5. To execute SQL statements, you need to instantiate a _____________ object usingthe ______________ object.

    A. Connection , Statement B. Statement, ConnectionC. JDBC Driver, Statement D. JDBC DriverManager, Statement

    6. Which of the following statements are false?A. The getConnection() method is used to establish a connection.B. An application can have more than one connection with a database.C. An application cannot have more than one connection with a database.

    D. An application can have many connections with different databases.

    7. The _______________ method is used to instantiate a statement object using theconnection object

    A. getConnection() B. getStatement()C. createConnection() D. createStatement()

  • 8/12/2019 Database Connectivity to Mys

    3/7

    8. The ____________ method is used to move to the next row of the result set.A. next() B. findNext()C. last() D. forward()

    WEB APPLICATION DEVELOPMENT/HTML

    MULTIPLE CHOICE QUESTIONS

    1. The address of a resource on the net is known as:(a) ISP (b) HTTP(c ) URL (d) WWW

    2. A program that serves requested HTML files and pages.(a) Web Address (b) Web Page(c ) Web Server (d) None of these

    3. HTML tags must be written within:(a) < > (b) { }

    (c) [ ] (d) ( )

    4. Which of the following is the correct structure of HTML tags?(a) < HTML> (b) (c) (d)

    5. Which of the following tags is used to specify the items in a list.(a) (b) (c ) (d)

    6. The IMAGE tag uses the _______ attribute to specify the URL of the image to bedisplayed.(a ) SCR (b) SRC(c ) Source (d) None of these

    7. The align attribute of tag refers to _________ placement of the table inrelation to the window screen.(a) Vertical (b) horizontal(c ) Both a and b (d) None of these

    8. Choose the best suitable input type to input gender from the user:(a) Text (b) Submit(c) checkbox (d) Radio

    9. Elements, such as heading, paragraph and tables etc can be contained in the FORMelement.(a) Holds True always (b) Holds True Sometimes(c) Is Never True (d) None of these

  • 8/12/2019 Database Connectivity to Mys

    4/7

    10. Data entry on a web page can be done using:(a) Tables (b) Formatting Tags(c ) Forms (d) Lists

    11. Which tag is used to embed an image in an HTML document.(a) (b) (c ) (d)

    12. To create a nested list we use the tag:

    (a) (b) (c ) (d) combination of (a) and (b) as required.

    13. Input type="________" will send the form to its destination place.(a) Button (b) File(c) Submit (d) Reset

    14. FACE is the attribute of which tag:(a) (b) (c )

    (d)

    15. Radio buttons can be grouped together so that only one is selected at a time byusingthe attribute:(a) name (b) selected(c ) checked (d) font

    16. XML document is used to(a) Only interpret data(b) Store any kind of data(c) Store only highly structured data (like in databases)(d) Store only loosely structured data (like letters)

    17. XML can be used to(a) Exchange data (b) Store data(c) Interpret data (d) All of these

    18. Every XML document must begin with a(a) Root element (b) Child element(c) XML version details (d) Any of these

    WEB APPLICATION DEVELOPMENT

    1 In the URL, http://www.mycorp.com/pr/master.htm, what is the http component?Ans.

    2 In the URL, http://www.mycorp.com/pr/master.htm, what is thewww.mycorp.com component?Ans.

  • 8/12/2019 Database Connectivity to Mys

    5/7

    3 In the URL, http://www.mycorp.com/pr/master.htm, what is the /pr/master.htmcomponent?Ans.

    4 How is a file communicated to another computer on Internet?Ans.

    5 What is WWW? How does it function?Ans

    6 What is a URL? What are its components? Example required.Ans.

    HTML-I:BASIC HTML ELEMENT

    7 HTML stands for _______________?Ans.

    8 What do you understand by TAG?Ans

    9 What is an attribute in HTML?Ans

    10 HR tag is used for _____________?Ans.

    11 tag is used to define ____________________.Ans.

    12 What is the basic structure of HTML File?Ans.

    13 Face attribute is used with _____________tag and used for _______.Ans

    14 To align multiple lines of text we use ______(a) Justify(b) DIV(c) Align(d) None of theseAns.

    15 What is the use of size in tag?Ans.

    16 List the attributes of tag?Ans.

    17 List and define different types of paragraph alignments.Ans.

  • 8/12/2019 Database Connectivity to Mys

    6/7

    18 State True or False.(a)
    tag has its closed tag as (b)

    tag has no closing tag(c) tag is same as
    (d) tag is used to display tablesAns.

    19 The default alignment of text is ________, default text color is ________and the defaultbackground color is

    ____________.Ans.

    20 Differentiate between and tags?Ans.

    21 Differentiate between container and empty elements?Ans.

    22 Differentiate between
    and

    tags.Ans.

    23 List and define different types of heading tags.Ans.

    24 List and explain the different attributes of body tag?Ans.

    25 What is the difference between basefont and font tag?Ans.

    HTML-II:LISTS, TABLES AND FORMS

    26 What type of lists are supported by HTML?Ans.

    27 Which three tags let you create the definition lists?Ans.

    28 What is the table? Which tag is used to create tables in HTML?Ans. A table is a collection of rows and column. tag is used to create tables in HTML.

    29 How is spacing in cells of table controlled?Ans.

    30 How can you specify following in a table?(i) Background image ii) Background colour.(ii) Table height vi) Table width.Ans.

    31 Which tag is used to specify(i) Table data? Ii) Table header? iii) Table row?Ans

  • 8/12/2019 Database Connectivity to Mys

    7/7

    32 Name the attributes used for following?(i) Setting the cell width ii) Setting cells background image iii) Setting cells backgroundcolourvi ) Changing the cell span v) Aligning cell contents vertically.Ans.

    33 Name different control types supported by HTML forms.Ans.

    34 Write the tags to define the following:(i) A text box(ii) A text area(iii) A radio button(iv) A check box(v) A password box(vi) A pop up box(vii) Submit button(viii) A label.Ans.

    35 Differentiate between ordered and unordered lists.

    Ans.

    36 How would you indent a single word and put a square bullet in front of it?Ans.