- Product Components of JDBC
- Understanding the JDBC Architecture
- JDBC Driver and Its Types
- JDBC Versions
- Relational Database Concepts
- Understanding Common SQL statements
- Introduction to java.sql package
- Driver Manager Class
- Understanding Connection Object
- JDBC Example with MySQL
- Creating a Database in MySQL
- Description of Database Table
- Inserting values in MySQL database table
- JDBC - Java Database Connectivity Tutorials
Basic computer tutorials and interview Questions tips, Java, C, C++ , Database, Tech news, Job interview questions, Interview tips, Tutorials online, Free Tutorials downloads web tutorials online
Thursday, September 23, 2010
Java Tutorial
BEE to rate computer data centres from next year
NEW DELHI: The Bureau of Energy Efficiency will start rating, from the next year, the energy-guzzling computer data centres that host companies' networking equipment and applications, on the basis of their efficiency.
"The BEE under the Power Ministry and Indian Green Building Council (IGBC) along with the software giants like Wipro and Infosys is developing a system to measure the data centres," said Prem C Jain, Chairman of IGBC, an arm of Confederation of Indian Industry (CII).
The data centres would be measurable which means how much the centre can consume beyond their data storage. They will then be rated as "Silver", "Gold" or "Platinum", depending on their consumption capacity, he explained.
Jain was of the opinion that the rating for data centres becomes all the more important in view of rapid growing information technology sector and internet usage.
However, though the guidelines would not be mandatory, he asserted that the rating would help the operators and owners of these centres reduce their environmental impact besides saving energy.
By combining various measures, savings of between 30 and 40 per cent over conventional data centre energy consumption are achievable.
"And unless they (for instance IT firms) opt for green data centres their energy bill will shoot up sharply which is also not good for climate change," he added.
"Several IT companies like IBM and Wipro have already expressed their desire for such a rating system which would help them setting up energy-efficient data centres," Jain said.
"The BEE under the Power Ministry and Indian Green Building Council (IGBC) along with the software giants like Wipro and Infosys is developing a system to measure the data centres," said Prem C Jain, Chairman of IGBC, an arm of Confederation of Indian Industry (CII).
The data centres would be measurable which means how much the centre can consume beyond their data storage. They will then be rated as "Silver", "Gold" or "Platinum", depending on their consumption capacity, he explained.
Jain was of the opinion that the rating for data centres becomes all the more important in view of rapid growing information technology sector and internet usage.
However, though the guidelines would not be mandatory, he asserted that the rating would help the operators and owners of these centres reduce their environmental impact besides saving energy.
By combining various measures, savings of between 30 and 40 per cent over conventional data centre energy consumption are achievable.
"And unless they (for instance IT firms) opt for green data centres their energy bill will shoot up sharply which is also not good for climate change," he added.
"Several IT companies like IBM and Wipro have already expressed their desire for such a rating system which would help them setting up energy-efficient data centres," Jain said.
Thursday, April 29, 2010
Retrieving All Rows from a Database Table
Here, you will learn how to retrieve all rows from a database table. You know that table contains the data in rows and columns format. If you want to access the data from a table then you need to use some APIs and methods. See brief descriptions for retrieving all rows from a database table as below:
Description of program:
Program establishes the connection between MySQL database and java file so that the we can retrieve all data from a specific database table. If any exception occurs then shows a message "SQL code does not execute.".
Description of code:
executeQuery(String sql):
This method executes the SQL statement and returns a single ResultSet object. It takes string type parameter for executing the SQL statement.
SELECT * FROM table_name:
Above code retrieves all data from specific database table.
getInt(String column_name):
This method is of java.sql.ResultSet interface that takes string type parameter and returns an integer type values.
getString(String column_name):
This method is same as getInt() method but it returns the string type values.
Here is the code of program:
Description of program:
Program establishes the connection between MySQL database and java file so that the we can retrieve all data from a specific database table. If any exception occurs then shows a message "SQL code does not execute.".
Description of code:
executeQuery(String sql):
This method executes the SQL statement and returns a single ResultSet object. It takes string type parameter for executing the SQL statement.
SELECT * FROM table_name:
Above code retrieves all data from specific database table.
getInt(String column_name):
This method is of java.sql.ResultSet interface that takes string type parameter and returns an integer type values.
getString(String column_name):
This method is same as getInt() method but it returns the string type values.
Here is the code of program:
import java.sql.*;
public class GetAllRows{
public static void main(String[] args) {
System.out.println("Getting All Rows from a table!");
Connection con = null;
String url = "jdbc:mysql://localhost:3306/";
String db = "jdbctutorial";
String driver = "com.mysql.jdbc.Driver";
String user = "root";
String pass = "root";
try{
Class.forName(driver).newInstance();
con = DriverManager.getConnection(url+db, user, pass);
try{
Statement st = con.createStatement();
ResultSet res = st.executeQuery("SELECT * FROM employee6");
System.out.println("Emp_code: " + "\t" + "Emp_name: ");
while (res.next()) {
int i = res.getInt("Emp_code");
String s = res.getString("Emp_name");
System.out.println(i + "\t\t" + s);
}
con.close();
}
catch (SQLException s){
System.out.println("SQL code does not execute.");
}
}
catch (Exception e){
e.printStackTrace();
}
}
}
Output of Program
Wednesday, February 10, 2010
HR Interview Questions and Job Interview Questions
Tell me about yourself.
Since this is often the opening question in an interview, be extra careful that you don't run off at the mouth. Keep your answer to a minute or two at most. Cover four topics: early years, education, work history, and recent career experience. Emphasize this last subject. Remember that this is likely to be a warm-up question. Don't waste your best points on it.
What do you know about our organization?.
You should be able to discuss products or services, revenues, reputation, image, goals, problems, management style, people, history and philosophy. But don't act as if you know everything about the place. Let your answer show that you have taken the time to do some research, but don't overwhelm the interviewer, and make it clear that you wish to learn more.
You might start your answer in this manner: "In my job search, I've investigated a number of companies.
Yours is one of the few that interests me, for these reasons..."
Give your answer a positive tone. Don't say, "Well, everyone tells me that you're in all sorts of trouble, and that's why I'm here", even if that is why you're there.
Why do you want to work for us?
The deadliest answer you can give is "Because I like people." What else would you like-animals?
Here, and throughout the interview, a good answer comes from having done your homework so that you can speak in terms of the company's needs. You might say that your research has shown that the company is doing things you would like to be involved with, and that it's doing them in ways that greatly interest you. For example, if the organization is known for strong management, your answer should mention that fact and show that you would like to be a part of that team. If the company places a great deal of emphasis on research and development, emphasize the fact that you want to create new things and that you know this is a place in which such activity is encouraged. If the organization stresses financial controls, your answer should mention a reverence for numbers.
If you feel that you have to concoct an answer to this question - if, for example, the company stresses research, and you feel that you should mention it even though it really doesn't interest you- then you probably should not be taking that interview, because you probably shouldn't be considering a job with that organization.
Your homework should include learning enough about the company to avoid approaching places where you wouldn't be able -or wouldn't want- to function. Since most of us are poor liars, it's difficult to con anyone in an interview. But even if you should succeed at it, your prize is a job you don't really want.
Since this is often the opening question in an interview, be extra careful that you don't run off at the mouth. Keep your answer to a minute or two at most. Cover four topics: early years, education, work history, and recent career experience. Emphasize this last subject. Remember that this is likely to be a warm-up question. Don't waste your best points on it.
What do you know about our organization?.
You should be able to discuss products or services, revenues, reputation, image, goals, problems, management style, people, history and philosophy. But don't act as if you know everything about the place. Let your answer show that you have taken the time to do some research, but don't overwhelm the interviewer, and make it clear that you wish to learn more.
You might start your answer in this manner: "In my job search, I've investigated a number of companies.
Yours is one of the few that interests me, for these reasons..."
Give your answer a positive tone. Don't say, "Well, everyone tells me that you're in all sorts of trouble, and that's why I'm here", even if that is why you're there.
Why do you want to work for us?
The deadliest answer you can give is "Because I like people." What else would you like-animals?
Here, and throughout the interview, a good answer comes from having done your homework so that you can speak in terms of the company's needs. You might say that your research has shown that the company is doing things you would like to be involved with, and that it's doing them in ways that greatly interest you. For example, if the organization is known for strong management, your answer should mention that fact and show that you would like to be a part of that team. If the company places a great deal of emphasis on research and development, emphasize the fact that you want to create new things and that you know this is a place in which such activity is encouraged. If the organization stresses financial controls, your answer should mention a reverence for numbers.
If you feel that you have to concoct an answer to this question - if, for example, the company stresses research, and you feel that you should mention it even though it really doesn't interest you- then you probably should not be taking that interview, because you probably shouldn't be considering a job with that organization.
Your homework should include learning enough about the company to avoid approaching places where you wouldn't be able -or wouldn't want- to function. Since most of us are poor liars, it's difficult to con anyone in an interview. But even if you should succeed at it, your prize is a job you don't really want.
Monday, February 8, 2010
In what way java is 'simple'?
In what way java is 'simple'?
Ans:) No langauage is simple,but JAVA is a bit easier compared to the popular object oriented programming language C++, which has been the dominant software development language in the past.Java is partially modelled after C++,but greatly simplified and improved.For example,pointers and multiple inheritance in C++ make programming complicated.Java replaced multiple inheritance in C++ with a simple structure called interface and eliminated pointers. Java uses automatic memory allocation and garbage collection, while C++ requires the programmer to allocate memory to collect the garbage
Ans:) No langauage is simple,but JAVA is a bit easier compared to the popular object oriented programming language C++, which has been the dominant software development language in the past.Java is partially modelled after C++,but greatly simplified and improved.For example,pointers and multiple inheritance in C++ make programming complicated.Java replaced multiple inheritance in C++ with a simple structure called interface and eliminated pointers. Java uses automatic memory allocation and garbage collection, while C++ requires the programmer to allocate memory to collect the garbage
What are the features of java?
What are the features of java?
Ans:) As stated in the Java language whitepaper by SUN:" Java is simple,objet oriented,distributed,interpreted, robust,secure,architecture neutral,portable,high performance, multithreaded and dynamic".
Ans:) As stated in the Java language whitepaper by SUN:" Java is simple,objet oriented,distributed,interpreted, robust,secure,architecture neutral,portable,high performance, multithreaded and dynamic".
What is OOP
What is OOP
Ans:) OOP is the fullform for "Object Oriented Programming". Object Oriented Programming providesgreat flexibility,modularity,clarity,and reusability through method abstraction and class inheritance
Ans:) OOP is the fullform for "Object Oriented Programming". Object Oriented Programming providesgreat flexibility,modularity,clarity,and reusability through method abstraction and class inheritance
Java Interview Questions
What is JAVA?
Ans:) Java is a cross-platform,object oriented,network based and multimedia ready language. Java, formerly known as oak, is an object-oriented programming language developed by Sun. It shares many superficial similarities with C, C++, and Objective C (for instance for loops have the same syntax in all four languages); but it is not based on any of those languages, nor have efforts been made to make it compatible with them. Java is the internet programming language as the future of computing is highly influenced by the Internet.
Ans:) Java is a cross-platform,object oriented,network based and multimedia ready language. Java, formerly known as oak, is an object-oriented programming language developed by Sun. It shares many superficial similarities with C, C++, and Objective C (for instance for loops have the same syntax in all four languages); but it is not based on any of those languages, nor have efforts been made to make it compatible with them. Java is the internet programming language as the future of computing is highly influenced by the Internet.
Subscribe to:
Posts (Atom)