Professional Documents
Culture Documents
1. What’s the command to see the current user name? Sql> show
user;
2. What’s the command to change the SQL prompt name?
3. How do you switch to DOS prompt from SQL prompt? SQL> host
4. How do I eliminate duplicate rows in an Oracle database?
or
7. The NVL function only allows the same data type. But here’s the task:
if the commission field is null, then the text “Not Applicable”
should be displayed, instead of blank space. How do you write the
query?
18. How would you go about increasing the buffer cache hit
ratio? - Use the buffer cache advisory over a given workload
and then query the v$db_cache_advice table. If a change was
necessary then I would use the alter system set db_cache_size
command.
19. Explain an ORA-01555 - You get this error when you get a
snapshot too old within rollback. It can usually be solved by
increasing the undo retention or increasing the size of rollbacks.
You should also look at the logic involved in the application
getting the error message.
1.
3. How many types of JDBC Drivers are present and what are
they?- There are 4 types of JDBC Drivers
o JDBC-ODBC Bridge Driver
o Native API Partly Java Driver
o Network protocol Driver
o JDBC Net pure Java Driver
4. Can we implement an interface in a JSP?- No
18. How do I mix JSP and SSI #include?- If you’re just including raw
HTML, use the #include directive as usual inside your .jsp file.
19. <!--#include file="data.inc"-->
But it’s a little trickier if you want the server to evaluate any JSP code
that’s inside the included file. If your data.inc file contains jsp code you
will have to use
20. I made my class Cloneable but I still get Can’t access protected
method clone. Why?- Some of the Java books imply that all you
have to do in order to have your class support clone() is implement
the Cloneable interface. Not so. Perhaps that was the intent at some
point, but that’s not the way it works currently. As it stands, you have
to implement your own public clone() method, even if it doesn’t do
anything special and just calls super.clone().
22. What is the fastest type of JDBC driver?- JDBC driver performance
will depend on a number of issues:
o the quality of the driver code,
o the size of the driver code,
o the database server and its load,
o network topology,
o the number of times your request is translated to a different
API.
In general, all things being equal, you can assume that the more your
request and response change hands, the slower it will be. This means
that Type 1 and Type 3 drivers will be slower than Type 2 drivers (the
database calls are make at least three translations versus two), and
Type 4 drivers are the fastest (only one translation).
boolean hasParameter =
request.getParameterMap().contains(theParameter); //(which
works in Servlet 2.3+)
4. Hierarchy of DWH?
27. How can you define a transformation? What are different types
of transformations in Informatica?
34. What is up date strategy and what are th options for update
strategy?
1. How do you call a Stored Procedure from JDBC? - The first step is
to create a CallableStatement object. As with Statement and
PreparedStatement objects, this is done with an open Connection
object. A CallableStatement object contains a call to a stored
procedure.
2. CallableStatement cs =
3. con.prepareCall("{call SHOW_SUPPLIERS}");
4. ResultSet rs = cs.executeQuery();
11. What is Metadata and why should I use it? - Metadata (’data
about data’) is information about one of two things: Database
information (java.sql.DatabaseMetaData), or Information about a
specific ResultSet (java.sql.ResultSetMetaData). Use
DatabaseMetaData to find information about your database, such as its
capabilities and structure. Use ResultSetMetaData to find information
about the results of an SQL query, such as size and types of columns
4. Create a properly formatted JDBR URL for your database. (See FAQ on
JDBC URL for more information). A JDBC URL has the form
jdbc:someSubProtocol://myDatabaseServer/theDatabaseName
5. Class.forName("my.database.driver");
6. Connection conn = DriverManager.getConnection("a.JDBC.URL",
“databaseLogin","databasePassword");
4. How do you get Column names only for a table (SQL Server)?
Write the Query. -
5. select name from syscolumns
6. where id=(select id from sysobjects where
name='user_hdr')
order by colid --user_hdr is the table name