Чашечка Java
رفتن به کانال در Telegram
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
نمایش بیشتر8 554
مشترکین
-424 ساعت
-197 روز
-2530 روز
آرشیو پست ها
8 553
When to throw and catch Exception in Java? [Best Practice]
Exceptions are one of the confusing and misunderstood topics in Java, but at the same time, too big to ignore. In fact, good knowledge of Errors and Exception handling practices is one criterion, which differentiates a good Java developer from an average one. So what is confusing about Exception in Java? Well, many things like When to throw Exception or When to catch Exception, When to use checked exception or unchecked exception, should we catch errors like java.lang.OutOfMemoryError? Shall I use an error code instead of an Exception and a lot more? Well, I cannot answer all these questions in one post, so I will pick the first one when to catch or throw any Exception in Java.
Java Interview questions and tutorials
Read: http://www.java67.com/2021/06/when-to-throw-and-catch-exception-in.html
8 553
How to Fix java.sql.BatchUpdateException: Error converting data type float to numeric - Java + SQL Server
This error can come if you are inserting or updating a NUMERIC column in the Microsoft SQL Server database from a Java Program using the executeUpdate()method, I mean executing a batch update query. It could also happen if you are calling a stored procedure and passing a float value corresponding to a NUMERIC column, and the value happened to be out-of-range like generating "Arithmetic overflow error converting numeric to data type numeric"on the SQL Server end. For example, if your column is defined as NUMERIC (6,2) the maximum value it can represent is 9999.99, not 999999.99.
Java Interview questions and tutorials
Read: http://www.java67.com/2019/04/javasqlbatchupdateexception-error-converting-data-type-float-to-numeric.html
8 553
How to Fix SQLServerException: The index is out of range? JDBC Example
I was executing a stored procedure against SQL SERVER 2008 database from Java program using CallableStatement, but unfortunately, I was getting the following error "SQLServerException: The index 58 is out of range". Since I am passing a lot of parameters I thought that something is wrong with a number of parameters I was passing to the stored proc. My stored procedure had 58 INPUT parameters, as soon as I removed the 58th INPUT parameter the error goes away, which confirmed my belief that SQL Server supports a maximum of 57 INPUT parameters in stored procedure via JDBC.
Java Interview questions and tutorials
Read: http://www.java67.com/2015/12/sqlserverexception-index-58-is-out-of-range-SQL-SERVER-stored-proc.html
8 553
How to deal with java.lang.NullPointerExceptionin Java? Cause, Solution, and Tips to avoid NPE
Hello Java programmers, if you want to learn what is NullPointerExcpeiton in Java and how to deal with NullPointerException or NPE then you have come to the right place. NullPointerException in Java is an unchecked
Exception defined in java.lang package and comes when a member
of an object either field or method is called on an object which is null. null
is a keyword in Java that means nothing and the calling method on an object whose
value is null will result in NullPointerException. Since the default value of Object
is null, if you call any method or access any field on an Object which is not initialized will throw NullPointerException.
Java Interview questions and tutorials
Read: http://www.java67.com/2021/05/how-to-solve-nullpointerexception-in-java.html
8 553
How to solve java.sql.BatchUpdateException: String or binary data would be truncated in Java JDBC? [Solution]
Recently I was working in a Java application that uses Microsoft SQL Server at its backend. The architecture of the Java application was old i.e. even though there was heavy database communication back and forth there was no ORM used like no Hibernate, JPA, or Apache iBatis. The Java application was using an old DAO design pattern, where the DB related classes which are responsible for loading and storing data from the database was calling the stored procedure to do their job. These stored procedures take data from Java applications and insert it into SQL Server tables.
Java Interview questions and tutorials
Read: http://www.java67.com/2016/10/how-to-solve-javasqlbatchupdateexception-string-or-binary-data-would-be-truncated.html
8 553
How to deal with Unsupported major.minor version 55.0, 57,0, 60.0, 61.0 in Java + Eclipse + Linux [Solution]
The "unsupported major.minor version 55.0"error started to come after Java SE 11 release and the root cause of this error is trying to run a Java application compiled with JDK 11 into a JRE lower than Java SE 11 like JRE 9 or JRE 8. This is very common because a developer has updated their compiler or IDE to Java SE 11 but many times their runtime is not upgraded to Java 11. If you remember, in Java you can run a class file compiled with a lower version say Java 8 to a higher version say JRE 11 because Java is backward compatible but vice-versa is not allowed. I mean, you cannot run a JAR file or class file created by Java 11 version into Java 8 or Java 9 version. Similarly, you cannot run a Java SE 17 compiled class file in Java SE 11 or Java SE 13 runtime environment.
Java Interview questions and tutorials
Read: http://www.java67.com/2016/06/unsupported-majorminor-version-520-in-java-eclipse-linux.html
8 553
How to Fix java.lang.NoClassDefFoundError: org/dom4j/DocumentException [Solution]
Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/DocumentException comes when your program is using the DOM4j library but necessary JAR is not present. This error can also come when you are indirectly using the DOM4j library like when you use the Apache POI library to read the XLSX file in Java, this library needs dom4j.jar in your classpath. Not just this one but there are several other libraries that use this JAR internally, if you are using any of them but don't have this JAR then your program will compile fine but fail at runtime because JVM will try to load this class but will not be able to find it on the classpath.
Java Interview questions and tutorials
Read: http://www.java67.com/2015/06/org.dom4j.DocumentException-javalangnoclassdeffounderror.html
8 553
[Solved] Exception in thread "main" java.lang.IllegalStateException during Iterator.remove() in Java
Hello guys, if you are wondering how to deal with java.lang.IllegalStateException while trying to remove elements from ArrayList in Java then you have come to the right place. In this article, I am going to share how I solved this problem and how you can do the same. I was writing a sample program to demonstrate how to remove elements from the list while iterating over it by using the Iterator.remove() method. Unfortunately, I was getting the following error, right at the place where I was calling the Iterator.remove() method :
Java Interview questions and tutorials
Read: http://www.java67.com/2016/01/exception-in-thread-main-java.lang.IllegalStateException-Iterator-remove.html
8 553
Хотите создавать высококлассные приложения на Java? Осваивайте Spring
25 апреля в 20:00 приходите на открытый урок «Свойства Spring-приложения».
На встрече разберут, каким образом можно определять настройки приложения на чистом Spring, а также затронут тему конвертации типов.
Спикером выступит преподаватель Александр Оруджев, Senior Software Engineer.
Вебинар состоится в рамках запусках онлайн-курса «Разработчик на Spring Framework» в OTUS. Сейчас курс доступен в рассрочку.
Для участия пройдите вступительный тест: https://otus.pw/o4bh/
Реклама ООО «Отус Онлайн-Образование» LjN8KUsJs
8 553
В какой сказке встречаются Баба Яга и Колобок или сказ о том как мы таск-трекер писали, часть вторая
Всем привет, как и обещали, публикуем продолжение. Первая часть, напомню, здесь (если не читали, то лучше начать с нее, чтобы картина была цельной).
Читать: https://habr.com/ru/companies/rostelecom/articles/721876/?utm_campaign=721876
8 553
Oracle expands availability of Java 8 performance pack
Read: https://www.infoworld.com/article/3694070/oracle-expands-availability-of-java-8-performance-pack.html#tk.rss_java
8 553
What is Synchronized Keyword and Method in Java? Example
synchronized keyword in Java is one of the two important keywords related to concurrent programming in Java, the other being a volatile keyword. the synchronized keyword is used to provide mutual exclusion, thread safety, and synchronization in Java. Unlike Volatile keyword, synchronized keyword is not an application to instance variable and you can only use synchronized keyword either with synchronized method or block. synchronized keyword work with the concept of lock, any thread which holds a lock on which synchronized method or block is locked, can enter otherwise thread will wait till it acquires the lock. In Java programming language every object holds a lock and every class holds a lock, like two String objects s1, s2 holds two different object lock,s and String.class is used to represent class lock.
Java Interview questions and tutorials
Read: http://www.java67.com/2020/04/synchronized-keyword-method-and-block.html
8 553
Создаем eval через байт-код JVM
В интерпретируемых языках программирования (или в языках, которые включают возможность компиляции в runtime) есть возможность вычисления значения выражения, полученного из внешнего источника (например, для построения графика функции, введенной пользователем) с подстановкой актуальных значений переменных. Но JVM изначально ориентирована на компиляцию перед выполнением и механизма, аналогичного eval, в JVM нет (кроме, конечно, возможности использования Nashorn и использования eval в JavaScript-коде). В этой статье мы рассмотрим пример динамической генерации байт-кода из математического выражения.
Читать: https://habr.com/ru/companies/otus/articles/730160/?utm_campaign=730160
8 553
How to use DROP command to remove tables in Oracle, MySQL and SQL Server
Hello guys, if you want to learn about DROP command in SQL then you have come to the right place. Earlier, I have shared the best free SQL and Database coursesand several tutorials to learn SELECT, GROUP BY, and other important commands, and in this article, I will show you to use the DROP command in SQL. DROP is one of the basic SQL commands, which is used to DROP database objects. Since it's part of ANSI SQL, the DROP command is supported by all major database vendors, including Oracle, MySQL, and Microsoft SQL Server. A SQL DROP TABLE statement is used to delete a table definition and all data from a table, but DROP can also be used to drop index, view, trigger, or any other database object.
Java Interview questions and tutorials
Read: http://www.java67.com/2021/04/sql-drop-command-example-mysql-.html
8 553
[Solved] Caused by: java.sql.SQLSyntaxErrorException: ORA-01722: invalid number in Java and Oracle
Hello guys, if you are getting below error in your Java program and wondering how to solve this or just stuck then you have come to the right place. In this article, I will explain to you what causes the " java.sql.SQLSyntaxErrorException: ORA-01722: invalid number" error when you connect to an Oracle database from a Java program and how you can solve it.
But, first of all, let's take a look at the stack trace of this error which looks like below:
Java Interview questions and tutorials
Read: http://www.java67.com/2021/06/caused-by-java-01722-invalisqlsqlsyntaxerrorexception-ORA-01722-invalid-number.html
8 553
10 Essential SQL Commands and Functions Every Developer should learn
Hello guys, if you are starting with SQL and wondering which commands you should learn first then you have come at the right place. In this article, I have shared 10 most essential SQL commands and functions which I believe every programmer should learn. This includes commands to pull data from database as well write data into data, update data, and remove data from database. While writing in the SQL language, you will utilize an assortment of SQL keywords to make explanations and questions. An assertion includes a series of characters and SQL keywords that adjusts to the designing and grammar rules of the language and may influence information or control processes corresponding to your information.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/09/10-essential-sql-commands-and-functions.html
8 553
How to convert String to Integer SQL and Database? MySQL, Oracle, SQL server and PostgreSQL Example
Hello guys, if you are wondering how to convert VARCHAR to String in SQL then you are at the right place. In this article, we will cover various techniques to convert String to Integer in all databases - MySQL, Oracle, SQL server and PostgreSQL. To perform tasks or correlations or change between information in a SQL Server data set, the SQL information kinds of those values should coordinate. At the point when the SQL information types are unique, they will go through a cycle called type-projecting. The transformation of SQL information types, in this cycle, can be implied or unequivocal.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/08/how-to-convert-string-to-integer-sql.html
8 553
What is Normalization in SQL? 1NF, 2nd NF, 3rd NF and BCNF Example Tutorial
What is Normalization?
Normalization is one of the essential concept of relational database. It is the process or technique to remove duplicate data from tables and thus reduce the storage size. It also helps to maintain integrity of data. Normalization likewise assists with coordinating the information in the data set. It is a multi-step process that sets the information into even structure and eliminates the copied information from the relational tables. Normalization coordinates the segments and tables of a data set to guarantee that data set integrity constraints appropriately execute their conditions. It is an orderly method of deteriorating tables to take out information overt repetitiveness (redundant) and unfortunate qualities like Insertion, Update, and Deletion anomalies.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/08/what-is-normalization-in-sql-1nf-2nd-nf.html
8 553
How Long It Take To Become a DBA (Database Administrator) in 2023? 7 days, 1 month or 1 year?
Hello guys, if you want to become a Database Administrator in 2023 and wondering how long does it take to learn SQL and Database and become a professional Database Administrator or Junior DBA then you are at right place. In the past, I have shared free SQL and Database courses as well roadmap to become a Web Developer and in this article, I am going to share how long it will take you to become a DBA in 2023. Along the way, I will share best way to learn SQL and Database and what is the best way to become a DBA quickly. So continue reading and find out what it takes to become a DBA and get a job in real world. I will also share all the skills you need to become a DBA in 2023.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/12/how-long-it-take-to-become-dba-database.html
اکنون در دسترس! پژوهش تلگرام ۲۰۲۵ — مهمترین بینشهای سال 
