Tampilkan postingan dengan label why. Tampilkan semua postingan
Tampilkan postingan dengan label why. Tampilkan semua postingan

Why use PreparedStatement in Java JDBC – Example Tutorial

Rabu, 05 Maret 2014

PreparedStatement in Java is one of several ways to execute SQL queries using JDBC API. Java provides Statement,
PreparedStatement and CallableStatement for executing queries. Out of these three, Statement is used for general purpose queries, PreparedStatement is used for executing parametric query and CallableStatement is used for executing Stored Procedures. PreparedStatement is also a popular topic in java interviews. Questions like Difference between Statement and PreparedStatement in Java and How to prevent SQL Injection attacks in Java are popular java interview questions. In this Java JDBC tutorial we will see why should you use use PreparedStatement in Java, What are the major advantages of using PreparedStatement in Java and how PreparedStatement prevents SQL Injection attacks in Java.

This article is in continuation of my earlier post on database and java like 4 tips to improve performance of Java application with database and Difference between truncate and delete in SQL.If you haven’t read  them already you may found  those tutorial useful and interesting.
Read more »
Read More..

Why use SLF4J over Log4J for logging in Java

Rabu, 19 Februari 2014

Every Java programmers knows that logging is critical for any Java application, especially server side application, and many of them are already familiar with various logging libraries e.g. java.util.logging, Apache log4j, logback, but if you don't know about SLF4J, Simple logging facade for Java,  then it's time to learn and use SLF4J in your project. In this Java article, we will learn why using SLF4J is better than using log4j or java.util.logging. It’s been long time, since I wrote 10 logging tips for Java programmer,I don’t remember anything I have writing about logging. Anyway, let’s get back to topic, on contrary to all those logging libraries, there is a major difference between them and SLF4J. SLF4J or Simple logging Facade for Java is not really a logging implementation, instead it's an abstraction layer, which allows you to use any logging library in back-end. If you are writing API or utility library, which can be used internally or externally, then you really don't want that any client, which uses your library, should also stick with your choice of logging library. Suppose if a project is already using log4j, and you included a library say Apache Active MQ, which has dependency on logback, another logging library, then you need to include them as well, but if Apache Active MQ uses SL4J, you can continue with your logging library, without pain of adding and maintaining new logging framework. In short SLF4J make your code independent of any particular logging API, which is good think for public API developers. Though idea of abstracting logging library is not new and Apache commons logging is already using it, but now SLF4J is quickly becoming an standard for logging in Java world. Let's see couple of more reason to use SLF4J over log4j, logback or java.util.logging.
Read more »
Read More..

Norton Antivirus Why is it So Good at Protecting Your Computer

Jumat, 07 Februari 2014

One of the most trusted brands when it comes to antivirus is Norton. Not only is it one of the most effective brands that is out there but it is one most well known as well. People who are not computer experts know the Norton brand. There are not a lot of antivirus solutions out there that you can say that about. But the brand is not known just because of its name alone. There is a reason why people respect the software when they see it. In this article we will take a look at why Norton is so good and why you should use it on your computer.
The features that the software comes with
While it may be easy for people to believe that all antivirus software is the same, the truth is that it is not. All of the top software have different features that make them stand out from the others. Some of the features may include faster run time while some of the other software may have more built in capabilities. It is up to you to decide what you need in your antivirus software. Some people may need as many features that they can get while others only need the bare essentials. The Norton line of antivirus software has a lot of features that you are sure to love, lets go over a few of them.

The first thing that you should know about the software is that it has one of the quickest virus definitions update around. This is important when you are looking for an antivirus to run on your system. There are several pieces of malware released every day. You need to make sure that the antivirus that you choose will be able to stop them. Another thing that you should look for is whether the software is able to scan more than just the files that are on your computer. Is it able to scan new files that are in coming from different sources? If you receive an email that has an attachment, will your antivirus solution be able to handle it? The Norton antivirus solution can.
Easy install
The best part of using Norton antivirus is that there is a good chance that the software is already installed on your computer. When you purchase a new computer there is usually demo software that is already on it. Either MacAfee or Norton will be the demo antivirus solution that is on the computer. So this saves you the time of having to purchase it, download it, and then installing. You can just go through the software and at the end of the demo period, pay for it that way.


Article Source: http://EzineArticles.com/4774332
Read More..

Why Default or No Argument Constructor is Important in Java Class

Kamis, 06 Februari 2014

Almost all Java developers knows that compiler adds a default constructor or better known as no argument constructor in every Java class, but many of them forget that, it only does when you don't provide any other constructor. Which means it becomes developers responsibility to add a no argument constructor, if he is adding explicit constructor. Now, Why it's important to provide default constructor in Java, What happens if your class don't have a no argument constructor? Well, this is how it's asked in many Java interviews, most commonly as part of Spring and Hibernate interviews. It's not mandatory to define default constructor, but if you are writing Hibernate persistent class, JPA entities or using Spring framework to manage object creation and wiring dependencies, you need to be bit careful. Many of open source framework, uses reflection to create instance or Object at runtime, based upon name of class. For example When Hibernate creates instance of entities using reflection it uses Class.newInstance() method, which require a no argument constructor to create an instance. It's effectively equivalent of new Entity(). This method throws InstantiationException if it doesn't found any no argument constructor in Entity class, and that's why it's advised to provide a no argument constructor.
Read more »
Read More..

Why become a Java freelancer

Sabtu, 01 Februari 2014


You may also like:
This was written as a general discussion only. The terminologies may  differ in other countries. Check the tax laws and contractual agreements carefully in your jurisdiction.

Q. How many years of experience do you need before becoming a freelancer or a contractor?
A. Generally 2 to 5 years.

Q. Why work as a freelancer?
A.
  • Better pay.  Usually, 1.5 to 2 times the permanent staff. So, you can take some time off to travel or work on your passive income generating ideas.
  • Gives you more freedom, and opportunity to acquire wider range of skills. You will have better control of your career direction by carefully choosing your contracts. Ask the right questions at your job interviews.
  • Dont have to get involved with the company politics. Do your job well, and build your network to find your future contracts directly without having to go through the job agencies.
  • Gets you out of your comfort zone to explore other opportunities and acquire new skills. 
  • Overall gives you the professional (and  possibly financial) freedom.

Q. What are the disadvantages or risks of working as a freelancer or contractor?
A.
  • Job security risk as your income can be unstable, especially in a difficult job market. This is more true for freelancers than contractors. This is where working on your passive income generating ideas become handy. I tend to start looking for new contracts around 6 weeks prior to my current contract expires.
  • You may have to do additional paperwork as part of insurance (e.g. professional indemnity insurance) and tax requirements. You will also be under different type of scrutiny when you apply for loans as you will have to provide evidence that you have a steady income. I go through an umbrella company as their employee for a nominal fee of 3% of my rate. This not only frees me from any administrative tasks to concentrate more on what I enjoy doing, but also makes it easier to apply for loans.
  • Freelancers also run the risk of not getting paid. This is not much of a problem for the contractors unless they work for a start up or a company that is in a brink of receivership.  Do your research on the company. 
  • You also dont have the benefits like health benefits, sick pay, holiday pay, etc. But, this can be compensated in your regular rate.
  • You need to regularly prepare for your job interviews.

Q. Why a contractor or freelancer is paid more than permanent developers?
A.
  • cost to a company for a permanent employee with benefits can be 1.5 to 2.5 times the amount they see in their pay check 
  • As a compensation for short term or temporary nature of the assignment.  Freelancers or contractors can be easily hired and fired.
  • To attract specialized and wide range of skills. Companies can hire contractors for 3 reasons.  Aim for reason number 3 described in the next answer.
Q. Why do organizations hire freelancers or contractors?
A. For 3 main reasons outlined below.

1. to get someone to do some dirty or non-interesting work that  their permanent staff is not too keen to perform.  

2. to get some additional work force on a temporary basis to get the project over the line as it is not always possible to predict workload.

3. to get expertise, which lacks in the current team. For example, get a Java developer with drools experience, etc. So, as a contractor or freelancer, if you have Java experience with some niche skills like a commercial BPM framework like IBM Websphere Lombardi, Business Intelligence (BI) software like IBM Cognos or in-memory data grid like Oracle Coherence. In the third scenario, you can call yourself more a "consultant" than a contractor.
    When you get multiple job offers to choose from, favor offers that provide Java/JEE + a sought-after commercial product experience like  a BPM (e.g. Pegasystems), SOA (Oracle Service Bus), Business Intelligence (IBM Cognos BI),  BigData (e.g. Hadoop), etc as these skills and experience cannot be self-taught like Spring or Hibernate. Specialized skills are more sought-after.

    Q. Is there a difference between a Java contractor and a Java freelancer?
    A. Even though these terms are used interchangeably, there is a subtle difference.

    A contractor:  generally works for one client on an exclusive basis for a longer term say 3 to 12 months. Contractual agreements may prohibit you to work for other clients. You will get paid on an hourly or daily rate, and rates are generally 1.5 to 2 times the equivalent permanent role.You normally work at the clients location. You can find contract jobs through recruitment agencies, job advertisements or your network. This tends to have more security and steady income than a freelancer.

    A freelancer: generally works for multiple clients on a project by project basis for shorter period. You normally work at your location and visit the client office as needed. You will have to find your work on your own. You could even have overseas clients. There are popular websites like the ones listed below to bid for work. Handy to gain some extra income while gaining much needed hands-on experience.
    You can’t just jump on a freelance website and expect to pull jobs that will give you a good steady income. These are low-dollar markets as you will be competing with people around the world. Especially with people who are prepared to do the job for very low wages to gain much needed hands-on experience or to supplement their more permanent incomes. If your main focus is to gain more practical experience, then this is not a bad avenue.

    A volunteer: sole purpose is to gain much needed hands-on experience with a nominal pay or no pay. Good for beginners, and smaller businesses, charities, and community groups are more likely  to offer volunteer jobs.





    Freelancing means professional freedom, but it also means instability and the risk of failure. But if you risk your stability for something more in tune with your professional goals than a traditional job, you have the opportunity to build your name and reputation and reap more rewards.  You are the best person to decide what is best for you.

    "If you do not take risks, you will never accomplish anything."
      I have been working as a Java freelancer since 2003 and always found jobs one after another. I have shared my experience as to how you can become a freelancer (or a contractor) and what you can do to mitigate the risk. I use the term freelancer to be more of a contractor to work between 3 to 12 months for the same client.

      Disclaimer: This is a general discussion only. It is imperative that you consult your accountant for relevant business structure and tax laws in your jurisdiction.

      How to earn more as a Java developer?
      Always look beyond salary or rate when considering your options. Dont base your happiness on money alone. Job satisfaction and opportunity to grow further are equally important. Firstly, find something that you really enjoy doing., then see what happens ............


      You may also like:
      Read More..