Java: Kiểm tra kiến thức Swing-JDBC
1. Which method is used to select multiple items programmatically?
setSelectedIndices(int[] indices)
setSelectedIndex(int index)
setListData(Object[] items)
setSelectedIndex(int[] indices)
2. Whenever you select an item from the combo box the ______________ method of
ItemListener is invoked.
itemSelected()
isSelected()
itemAdded()
itemStateChanged()
3. A __________ is a component which displays its data in a hierarchical way.
JTable
JTree
JMenuList
JMenuItem
4. The process of creating an application that can adapt to a language or a country by adding
locale specific components which help in translation of text is referred as __________.
Translation
Internationalization
Standardization
Localization
5 ____________ provides a unique number for every character irrespective of platform, program
or language.
ByteCode
ASCII Encoding
Unicode
6. The currency of a particular country can be displayed in the correct format using the
___________ class.
MessageFormat
NumberFormat
CountryFormat
Locale
7. The _________ class is used to convert sentences from one locale to another without
introducing grammatical errors.
MessageFormat
NumberFormat
CountryFormat
Locale
8 The constructors of the URL class throw a __________ if no protocol is specified.
NullPointerException
InvalidArgumentException
MalformedURLException
InvalidProtocolException
9. The _______ method of the URL class returns the IP address enclosed in square brackets.
getFile()
getIP()
getHost()
getPath()
10. Instances of the ______ class can be used to read from and write to the resource referred by
the URL.
URL
InetAddress
Connection
URLConnection
11. An instance of the Socket class represents the _________ side of the connection.
server
client
application
I/O
12. A ServerSocket instance binds itself to a __________ and then waits and listens for client
requests to establish connections.
port
socket
IP address
URLConnection
13. A ________ is a class used to represent a menu on a menu bar.
JMenuBar
JMenu
MenuBar
JMenuItem
14. A __________________ is similar to a JMenuItem with the additional feature of selecting
and deselecting them.
JCheckBoxMenuItem
JCheckBoxMenu
JMenuItem
JMenuList
15. Swing provides the _____________________________ class to create filters.
javax.swing.FileFilter
javax.swing.filechooser.Filter
javax.swing.filechooser.FileFilter
16. A __________ is dockable only if the container it belongs to has a BorderLayout layout
manager.
JToolBar
JMenuBar
JCheckBoxMenuItem
JMenu
17. The __________ method is used to make the toolbar dockable.
setFloatable()
setDockable()
setDock()
setToolDockable()
18. The _____________ package has a class Color to create objects representing colours and
their shades.
javax.swing
java.awt
java.awt.colorchooser
javax.swing.colorchooser
19. The JColorChooser has a method __________________ which returns an object of the
ColorSelectionModel interface.
getSelectedModel()
getModelSelection()
getSelectionModel()
getSelection()
20. ____________ is a class used to display a group of items.
JList
JMenuList
JMenuItem
JFileChooser
DBSJ
1.which of the following are JDBC drivers?(chon 4)
A, JDBC –ODBC bridge
B ,Native API party – java driver
C, Net –Protocol all – java
D, ,JDBC – network driver
E, Native protocol all – java driver
2. The naming clss extend the -- -- -class
A serializable
B Object
C System
D Remote
3-the- -- -- -Class of java RMI provides stati methods for accep
A MarshalledObject
B Naming
C RMI Security Manager
D log Stream
E Remote Server
4 . the -- -- -use local native libraries to communicate with the database
A JDBC – ODBC Bridge
B Native – API – Partly- java driver
C ODBC net all java driver
D Native Protocol – all – java driver
5 . which interface of the JDBC API contains method used to execute SQL stored procedures
A statement
B resultset
C CallableStatement
6 .. . which interface of the JDBC API execute pre-compied SQL statement
A preparedStatement
B statement
C Resultset
7.which of the following three interfaces the JDBC API provides for sending SQL statements to
the database?
A Statement
B PreparedStatement
C callablestatement
D Connection
E Getconnection
8. the -- -- - class is the traditional managerment layer of JDBC working between the …. The
driver
a Driver manager
b Connection
c Resultset
9.The java software provides three JDBC product components they are (2d)
A The JDBC DriverManager facility
B The JDBC driver test suite
C The JDBC – ODBC bridge
D The callable stament
10. A -- -- -- obiect is used to send SQL statement to a database
A Connection
B Statement
C Driver
11 . Which interface of the JDBC API provides mothod to receive data that an SQL statement
returns?
A ResultSet
B Statement
C Driver
D Connection
12. Which two of the following are valid JDBC driver(choose 2)
a JDBC –ODBC bridge plus ODBC driver
b Native – API partly –Java drivr
c ODBC Driver
d Native java driver
13. Which kind of driver converts ODBC calls directly into the network protocol
A JDBC _ODBC bridge plus ODBC driver
B Native API partly java driver
C Native protocol pure java driver
14. Depending on scrollabity how many types of result sets are av…..
A One
B Four
C three
D Two
15. Which of the following classes contain the Execute() method?
A ResultSet
B RecordSet
C Statement
D Connection
16. The -- -- -method is used to retrieve the name of columns.
A getColumName()
B GetColumCaption()
C GetColumLabel()
D None of the others
17. The statement interface provides three different methods for executing SQL statement, they
are
A ExecuteQuery
B ExecuteUpdate
C Execute
D ExecuteDelete
E ExecuteInsert
18. Once the Driver classes have been loaded and registered with the driver avaitable for
eatablahing a connection with a database is the statement correct?
A true
B False