Monday, September 16, 2024

ORA-00904: invalid identifier Error in Oracle 11g database - Solved

If you have worked in the Oracle database ever, you would definitely have seen ORA-00904: invalid identifier error. Doesn't matter which version you are working 10g, 11g or 12g, this is one of the most common error comes while doing CRUD (Create, Read, Update, and Delete) operations in Oracle. By the way, if you are a beginner, SELECT, INSERT, UPDATE and DELETE are used to perform CRUD operations in the Oracle database. What do you do if you get this error while running in SQL script? Like any error, you should first pay attention to error message, what is Oracle trying to say here. Invalid identifier means the column name entered is either missing or invalid, this is one of the most common causes of this error but not the only one.

Difference between LEFT and RIGHT OUTER Joins in SQL - MySQL Join example

There are two kinds of OUTER joins in SQL, LEFT OUTER join and RIGHT OUTER join. The main difference between RIGHT OUTER joins and LEFT OUTER join, as their name suggests, is the inclusion of non-matched rows. Sine INNER join only include matching rows, where the value of the joining column is the same, in the final result set, but OUTER join extends that functionality and also include unmatched rows in the final result. LEFT outer join includes unmatched rows from the table written on the left of the join predicate. 

How to Convert JSON array to String array in Java - GSon example

A JSON array is an ordered collection of values, which are enclosed within brackets e.g. [] and separated by a comma. In this Java tutorial, we will convert JSON Array to String array in Java and subsequently create JSON from Java String Array. This tutorial is similar to our last article in JSON about How to convert JSON object to Java object, instead of a JSON object, here we will convert JSON array to String array or List in Java. As I said earlier, there are lots of open-source libraries out there that can help to parse JSON data format and we have already seen Jackson library in our last example. In this tutorial, we will use GSON to parse the JSON data format and create a Java String array or List from JSON array representation.

How to convert JSON String to Java object - Jackson Example

JSON stands for JavaScript object notation, is a lightweight text or string representation of an object and quickly becoming a popular data exchange format. Though it's pretty early to say that JSON is going to replace XML as a popular data interchange format, It is certainly providing an alternative. JSON represents data in two formats either an object or an array. The JSON object is an unordered collection of keys and values, similar to the String representation of the hash table. On the other hand, JSON Array is an ordered collection of values.

Top 8 Courses to Crack AWS Certified Cloud Practitioner Certification Exam (CLF-C02) in 2024 - Best of Lot

Hello guys, you may hear about the buzz around cloud computing and AWS, and cloud computing is indeed essential for today's programmers, developers, IT professionals, and project managers. And, if you want to know about Cloud computing concepts from scratch, there is no better way than to go for a certification like AWS Certified Cloud Practitioner (CLF-C02) or Azure Fundamentals (AZ-900). These are the first stepping stone on Cloud and the most specific accreditation you can get on Cloud computing. They provide an overview of Cloud computing concepts like IaaS, Pass, SaaS, how Cloud works in general, and what the cost and agility benefits of Cloud are.

Top 5 MySQL Courses for Programmers and DBAs to Learn Online in 2024 - Best Of Lost

Hello guys, if you are interested in learning SQL with MySQL database and looking for some awesome resources e.g. books, tutorials, and online courses then you have come to the right place. In past, I have shared some useful books and tutorials and in this article, I am going to talk about some of the best MySQL online courses from Udemy and Pluralsight which you can join to learn SQL and MySQL from the comfort of your office or home. In the last couple of years, you might have heard the statement that everybody should learn to code, which is great. Coding is now like reading, writing, and speaking skills and in today's Information technology-centric world it is a must-have and there is no better way to start coding than learning SQL, the most popular programming language.

Sunday, September 15, 2024

Coding Interview Cheat Sheet and Resources for Developers

Hello guys, are you looking for job in this tough market? Well, its not easy and market is flooded with a lot of talented people, thanks to what happening in the world. But that should not be an excuse. If you can refer right resources and put in efforts you can still get job, all comes down to how badly you want and how good is your preparation. In the past, I have shared best coding interview books and courses as well as many coding interview questions on String, Array, LinkedList, Binary Tree, Matrix, Recursion, Algorithms, and in general DSA. Today, I am going to share a gist of all these and I will share a coding interview cheat sheet with right resources so that you can get ready for coding interview in minimal amount of time.

Saturday, September 14, 2024

Top 5 React and Redux Courses to Learn Online in 2024 - Best of Lot

If you are a Web developer or someone passionate about web development and looking for some awesome courses to learn React or React JS, a popular JavaScript framework to develop a component-based user interface then you have come to the right place. Facebook's React library has taken the front-end development world by storm. More and more people have started using React even in favor of Google's Angular, another popular front-end development framework. Well, I am not going into the classic debate of Angular vs React as both the framework has their own advantage and disadvantage but if you have chosen to learn React, you have made the right decision.

Friday, September 13, 2024

How to design a Messaging App like Twitter on System Design Interview?

Hello guys, if you are preparing for system design interview and looking for common System deign problems and resources then you have come to the right place. In the past, I have shared best System Design courses, books, websites, newsletters, cheat sheets, mock interviews, blogs, tips, GitHub repo, and 100+ System Design Interview Questions and Problems and today I am going to discuss one popular System deign problem — designing Twitter or X.com. Designing a complex system like Twitter can be challenging, especially in a system design interview.

Top 10 Coursera Certifications and Courses to Learn Python in 2024 - Best of Lot

While there are many online platforms out there to learn Python Programming from scratch, Coursera is one of the most popular and reputed websites to learn Python for beginners. The best thing about Coursera is that it provides access to courses taught at the World's top universities like the University of Michigan and Rice University, one of the top 20 universities in the USA. It has also got the best Python certifications offered by the world's most reputed companies like IBM and Google and the world's top universities like the University of Michigan and Johns Hopkins University. That's why many people flock to Coursera to learn Python and other Computer Science and Software Engineering skills.

Thursday, September 12, 2024

Top 10 Java Programming Courses for Beginners to Learn Online in 2024 - Best of Lot

If you are a computer science graduate or someone who wants to learn Java and looking for some awesome resources like books, tutorials, and online courses then you have come to the right place. In the past, I have shared some great books, websites, and tutorials to learn Java and in this article, I am going to share some of the best Java courses beginners can join to learn Java in 2024. One of the main problems with learning Java is keeping pace with the increasing number of releases. For example, Java 8 release completely changed how Java is written and after that, we have many Java releases in the form of Java 9Java 10, Java 11, 12, 13, 14, 15, 16, and now Java 17. But the good thing is that the core of Java is still the same and all its releases are backward compatible.

Wednesday, September 11, 2024

The 2024 Data Analyst Roadmap

Hello guys, if you are want to become a Data Analyst in 2024 but not sure which skills you need and how to acquire those skills then you have come to the right place. Earlier, I have shared the Java Developer RoadMap, Python Developer RoadMap, Web Developer RoadMapiOS Developer RoadMap, and  DevOps Engineer RoadMap, and in this article, I will share the 2024 Data Analyst RoadMap which will help you to become a Data Analyst in 2024. As we continue to witness unprecedented growth in data generation across industries, the role of a data analyst has become more pivotal than ever. 

Parsing Large JSON Files using Jackson Streaming API Example

In the last couple of JSON tutorials for Java programmers, we have learned how to parse JSON using JSON-Simple library, parsing JSON array to Java array using GSon, and in this tutorial, we will learn how to parse a large JSON file in Java using Jackson's Streaming API. Jackson is one of the most popular JSON processing frameworks and provides three main models to parse and process JSON data including Streaming API, data binding, and tree model. Out of these three, Streaming works at the lowest level and can be used to parse huge JSON responses up to even gigabytes of size. If you are familiar with XML parsing, then you know that how difficult it is to parse huge XML files with DOM parser because it fully loads the file in memory before you can process it.

Tuesday, September 10, 2024

6 Websites to Learn Linux Command Line for FREE - Best of Lot

Hello guys, if you want to learn Linux online and are looking for free resources to learn Linux commands and concepts, you have come to the right place. Earlier, I have shared Linux and shell scripting courses and tutorials, and in this article, you will find the best places to learn Linux online. Linux is one of the most useful skills for Programmers and Developers, and there are a lot of useful resources on the internet to learn Linux and master Linux command lines or bash shells. In this article, I will share websites where you can learn Linux for FREE. I have tried to include a variety of websites like Udemy and Coursera for online courses, CodeCademy and Educative for online interactive learning, and Pluralsight as a membership-based website. 

How to Ignore Unknown Properties While Parsing JSON in Java? Example

One of the common problems while parsing JSON in Java using Jackson API is that it fails when your JSON contains unknown properties i.e. your Java class doesn't have all the fields corresponding to all JSON properties. For example, if you are consuming JSON from a REST Web Service and tomorrow they added a new field into JSON then your code will break because Jackson will throw UnrecognizedPropertyException and stop parsing JSON. This is troublesome and can cause problems in production if you are not aware. I  have faced this issue when a developer shipped the code to consume data from REST API without properly handling unknown fields.

Sunday, September 8, 2024

How to parse JSON with date field in Java - Jackson @JsonDeserialize Annotation Example

I have read many articles on parsing JSON in Java and most of them give examples where properties are either String or int, there are very few examples, where you will see the JSON string contains a date field and that's one important thing to learn. It's easy to parse JSON in Java using Jackson or Gson with just integer and string field but you need to do a little more work if your JSON contains a date field because everything in JSON is String but Java is a type-based programming language, where Date is a type.

Saturday, September 7, 2024

Top 5 JSON Library Java JEE Developers Should Know- Best of Lot

The JSON format is one of the most popular formats to transfer and exchange data on the web. Almost all RESTful web services take JSON input and provide JSON output but unfortunately, JDK doesn't have built-in support for one of the most common web standards like JSON. As a Java developer if you want to develop a RESTful web service and produce JSON data or if you are developing a client to existing RESTFul web services and want to consume JSON response, you don't need to be disappointed. Fortunately, there are so many open source libraries and APIs available for creating, parsing, and processing JSON response in Java, like Jackson, Google GSon, json-simple, etc.

Friday, September 6, 2024

10 Best Practices to Follow While Writing Code Comments

Comments are an important part of writing code not only in Java but whatever programming or scripting language you use. At the same time, this is one of the most abused things as well. Both writing no comment and writing too much comment is bad and this has been highlighted by many software gurus e.g. Robert C. Martin in his classic book Clean code. There is a whole chapter dedicated to How to write comments and finding the pros and cons of a comment. This article is my learning in the same direction, here I am going to share with you guys some 0f the rule and best practices I follow while writing comments.

6 JDBC Performance Tips for Java Developers

JDBC Performance tips are a collection of some tried and tested ways of coding and applying process which improves the performance of JDBC code. The performance of core Java application or J2EE web application is very important, especially if its user database in the back end which tends to slow down performance drastically. do you experience your java j2ee web application being very slow (taking few seconds to process simple requests which involve database access, paging, sorting, etc) then the below tips may improve the performance of your Java application? these tips are simple in nature and can be applied to other programming language application which uses the database as back-end. 

Dealing with Password in Java Application? 5 Best Practices You Should Follow

While working in core Java applications or enterprise web applications there is always a need of working with passwords in order to authenticate users. Passwords are very sensitive information like Social Security Number(SSN) and if you are working with real human data like in an online banking portal or online health portal it's important to follow best practices to deal with passwords or Social security numbers. here I will list down some of the points I learned and take care of while doing authentication and authorization or working with passwords. I recommend reading more on this topic and have a checklist of things based on your application requirement. Anyway here are few points which make sense to me:

Wednesday, September 4, 2024

How to create Immutable Class and Object in Java - Tutorial Example

Writing or creating immutable classes in Java is becoming popular day by day, because of the concurrency and multithreading advantage provided by immutable objects. Immutable objects offer several benefits over a conventional mutable object, especially while creating concurrent Java applications. Immutable object not only guarantees safe publication of object’s state but also can be shared among other threads without any external synchronization. In fact, JDK itself contains several immutable classes like String, Integer, and other wrapper classes.

What is difference between Enumeration and Iterator in Java? Answer

Though both Iterator and Enumeration allows you to traverse over elements of Collections in Java, there is some significant difference between them e.g. Iterator also allows you to remove elements from the collection during traversal but Enumeration doesn't allow that, it doesn't get remove() method. Enumeration is also a legacy class and not all Collection supports it e.g. Vector supports Enumeration but ArrayList doesn't. On the other hand, Iterator is the standard class for iteration and traversal. By the way,  what is the difference between Enumeration and Iterator in Java? 

Tuesday, September 3, 2024

Dealing with org.hibernate.LazyInitializationException: could not initialize proxy - no Session in Hibernate Java

If you are working in the Hibernate framework, then you know that one of the key features of Hibernate is "lazy initialization", which allows the framework to lazily initialize dependencies, relationships, or associations lazily from the database on a need basis. For example, if you are dealing with a User object, which has a relationship with a Permission object like one user can have multiple permissions, then Hibernate may choose not to initialize the collection which holds all permissions at the time it initialized User object and instead returns a proxy object.

How to fix org.hibernate.MappingException: Unknown entity Exception in Java? Solution

If you have used Hibernate with JPA and using annotation to declare your entity bean then you might have seen this confusing error called "org.hibernate.MappingException: Unknown entity". This error message is so misleading that you could easily lose anywhere between a few minutes to a few hours looking at the wrong places. I was using Spring 3 and Hibernate 3.6 when I got this error, which occurs when addEntity() method was executed. I checked everything, from Spring configuration file applicationContext.xml, Hibernate config file, my Entity class, and DAO class to see whether my Entity class is annotated or not, but I was still getting this error message.

Why JPA Entity or Hibernate Persistence Class Should Not be Final? Answer

One of the interesting hibernate interview questions is, why you should not make a Hibernate persistent class final? I'll try to answer this question in this short blog post. The use of proxies is the core feature of Hibernate (one of the most popular ORM frameworks for Java Projects) for implementing key performance features e.g. lazy loading and lazy associations fetching. In order to use a proxy in place of a real class, your hibernate persistence class must be either non-final or the implementation of an interface that declares all of the public methods. 

Monday, September 2, 2024

10 Difference between Hibernate and JDBC in Java

JDBC is the core technology to access database from Java application but it require lot of boiler plate coding. Hibernate on the other hand an ORM (Object Relational Mapping) framework, which automatically map Java object to tables and records in database. You don't need to execute query to populate objects, Hibernate will do that for you. It also provides several benefit as compared to JDBC e.g. performance improvement via Proxy, lazy loading of associations and Caching, that's why both enterprise Java application and web application uses Hibernate to implement the DAO layer of application.