Database Programming and .NET Framework
Quiz covering Oracle database errors and SQL, Visual Studio .NET development, and basic Java exception handling
Questions
You develop a Windows-Based application that accesses a Microsoft SQL Server database named ABC. Users must supply a user name and password when they start the application. This information is then used to dynamically build a connection string. When you test the application, you discover that it is not using the SqlClient connection pooling feature. You must reduce the time needed to retrieve information. How should you modify the connection string?
- to use the Windows user logon when connection to the TestKing1 database.
- to use the SQL Server used login when connection to the TestKing1 database.
- to use the same application logon ID and password for every connection to the TestKing1 database.
- to use the guest login ID and password for every connection to the TestKing1 database.
You are preparing a localized version of a Windows Form named ABCLocal. Users of ABCLocal speak a language that prints text from right to left. User interface elements on the form need to conform to this alignment. You must ensure that all user interface elements are properly formatted when the localized Windows Form runs. You must also ensure that ABCLocal is easy to update and maintain. What should you do?
- Set the RightToLeft property of each control on the form to Yes.
- Set the RightToLeft property of the form to Yes.
- Set the Language property of the form to the appropriate language.
- Set the Localizable property of the form to True.
You develop a Windows-based application that contains a form named ContactABC. You need to write code to initialize all class-level variables in ContactABC as soon as ContactABC is instantiated. You will place your code in a public procedure in the ContactABC class. Which public procedure should you use?
- Create
- Initialize
- Load
- New
You use Visual Studio .NET to create several Windows-based applications. All use a common class library assembly named ABCCustomers. You deploy the application to client computers on your company intranet. Later, you modify ABCCustomers.Any application that uses version 1.0.0.0 must now user version 2.0.0.0. What should you do?
- Modify the machine configuration file on your client computers.
- Modify the application configuration file for Customers.
- Modify the Publisher Policy file containing a reference to Customers.
- Modify the reference patch for Customers.
You develop a Windows-based application ABCApp by using Visual Studio .NET. ABCApp uses a SqlConnection object for database access. You typically run ABCApp on a computer that has limited RAM and hard disk space. After the code finishes using the SqlConnection object, you must ensure that the connection is closed and that any resources consumed by the object are released immediately. What should you do?
- Call the Finalize method of the SqlConnection object.
- Call the Dispose method of the SqlConnection object.
- Set the SqlConnection object equal to Nothing.
- Set the SqlConnection object equal to “”.
You plan to develop a customer information application CustomABC that uses a Microsoft SQL Server database. CustomABC will be used frequently by a large number of users. Your application code must obtain the fastest possible performance when accessing the database and retrieving large amounts of data. You must accomplish this goal with the minimum amount of code. How should you design CustomABC?
- Use classes in the System.Data.OleDb namespace.
- Use classes in the System.Data.SqlClient namespace.
- Use remoting to connect to the SQL Server computer.
- Use interoperability to include legacy COM-based data access components.
You use Visual Studio .NET to develop a component named ABCComponent. You plan to develop several client applications that use ABCComponent. You need to deploy ABCComponent with each of these applications. You will create a distribution package to be included with each application. Which type of project should you create?
- CAB project.
- merge module project.
- setup project.
- Web setup project.
You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?
- ALTER TABLE students ADD PRIMARY KEY student_id;
- ALTER TABLE students ADD CONSTRAINT PRIMARY KEY(student_id);
- ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;
- ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
- ALTER TABLE Students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
For Which two constraints does the Oracle server implicitly create a unique index? (Choose Two)
- NOT NULL
- PRIMARY KEY
- FOREIGN KEY
- CHECK
- UNIQUE
Which two statements about views are true? (Choose two)
- A view can be created as read only.
- A view can be created as a join on two or more tables
- A view cannot have a n ORDER BY clause in the SELECT statement.
- A view cannot be created with a GROUP BY clause in the SELECT statement.
Which three are DATETIME data types that can be used when specifying column definitions? ( Choose Three)
- TIMESTAMP
- INTERVAL MONTH TO DAY
- INTERVAL DAY TO SECOND
- INTERVAL YEAR TO MONTH
- TIMESTAMP WITH DATABASE TIMEZONE
Which data dictionary table should you query to view the object privileges granted to the user on specific columns?
- USER_TAB_PRIVS_MADE
- USER_TAB_PRIVS
- USER_COL_PRIVS_MADE
- USER_COL_PRIVS
ORA-01403 Means?
- No data found
- Internal error
- TNS:could not resolve service name"
- None of the above
ORA-01017 ?
- Oracle not available (the database is down)
- Invalid Username/Password
- Snapshot too old (Rollback has been overwritten)
- Unique constraint violated
ORA-00001 Means?
- PL/SQL Error
- No data found
- Insufficient privileges
- Unique constraint violated. (Invalid data has been rejected)
ORA-00001 Means?
- PL/SQL Error
- No data found
- Insufficient privileges
- Unique constraint violated. (Invalid data has been rejected)
From the following code fragments select the most appropriate way of throwing exceptions ?Assume that variable i is properly defined , in scope and has appropriate value
- if ( i > 10) { throws new IndexOutOfBoundsException("Index is out of bound!"); }
- if ( i > 10) { throw new IndexOutOfBoundsException("The value of index i=" + " is out of bound!" ); }
- if ( i > 10) { throw "Index is out of bound!"; }
- None of the ABove
ORA-03114 Means?
- Not connected to ORACLE
- Table or view does not exist
- Internal error (contact support)
- None Of The Above
ORA-03114 Means?
- Not connected to ORACLE
- Table or view does not exist
- Internal error (contact support)
- None Of The Above
ORA-12154 Means?
- TNS:name lookup failure"
- TNS:could not resolve service name"
- TNS:protocol adapter error"
- Package error raised with DBMS_SYS_ERROR.RAISE_SYSTEM_ERROR