Java Basic Problems

Problem and its Solution in SQL Query: How to solve If database table field is blank or null then replace or fill it with zero (0) or one (1) without using if condition in query||Solution procedure of if field = blank or Null then field =0 or 1

sql query

Have you ever faced a problem while using SQL Query in your software where you have to replace the blank or null field in database table with “0”  or  “1”  but  you are  unable to use “If condition” in the sql?


Here I have got a solution where you can replace  or fill the blank or null table data with “0” or “1” by using COALESCE   in SQL query.
 

Let us assume we have a table called “ITEM”   and it has four fields named “ order_no”, “item_no”, “qty” and  “style_sample_no” . In the field “style_sample_no” there is no data i.e.  this filed is blank/null or empty.

  Continue reading “Problem and its Solution in SQL Query: How to solve If database table field is blank or null then replace or fill it with zero (0) or one (1) without using if condition in query||Solution procedure of if field = blank or Null then field =0 or 1”

Java Basic Problems

Java Xml file to Jasper converter : How to convert Xml file into Jasper in Java using jasper-compiler, jasper-runtime and jasper_bundle||Source code example included.

xml to jasper javaFor the reporting purpose sometimes we may need to convert xml file into jasper.

Here I have tried to show you the conversion procedure of xml file to jasper file using Java Programming Language.

To do this you need the following jar (drivers actually) files

1. jasper-compiler.jar
2. jasper-runtime.jar
3. jasper_bundle.jar

Below, I have attached the Java Source Code of XML to JASPER Converter, Code to compile and run the source code. Also I have included an Image to show you the whole procedure.

Continue reading “Java Xml file to Jasper converter : How to convert Xml file into Jasper in Java using jasper-compiler, jasper-runtime and jasper_bundle||Source code example included.”

Java Basic Problems

Solution of Batch entry 0 insert into postgresql database table, Call getNextException to see the cause|| Learn How to solve this exception or error ||Java PostgreSQL Database Exception.

sun javaHave you ever faced this exception while executing sql query in  your software  or  database?? Well, I am using  Java programming language in the front end and PostGreSQL in the backend i.e. server side. Recently I have faced the following  exception which was showing actually from the database. I searched internet for the solution but didn’t get any reliable solution. But at last I have solved it and sharing the solution procedure with you. Hope it will also work with your problem

Here is the problem (Exception)

Batch entry 0 insert into endproduct_mat_req(item_no,end_product_mat_no,mat_no,qty) values(523,71,44,100000.0) was aborted.  Call getNextException to see the cause

Continue reading “Solution of Batch entry 0 insert into postgresql database table, Call getNextException to see the cause|| Learn How to solve this exception or error ||Java PostgreSQL Database Exception.”

Java Basic Problems

Java HashMap Key Set to String ,Array or Vector Convert: Use multiple type (String or Integer) data together as Key Value|| Procedure to retrieve (show) or get individual values from the multiple data type Hash Map key by splitting or breaking || next convert the key into vector.

hashmap key to vector or string array

After a long time I am sharing a post related to Java Programming language. Recently, I have faced a problem while coding   on java HashMap key value set on my job. In my last post I have shown How to show Java HashMap Key value pair and work on it. But the problem I have faced is to convert the Key value set to Vector or String. I used two (2) integer type data, separated with colon, as the key value of my HashMap.  What I need to convert that colon separated key values to individual integer and then convert them or stored them on Vector.

The program given below will show you how to solve such situation.

Continue reading “Java HashMap Key Set to String ,Array or Vector Convert: Use multiple type (String or Integer) data together as Key Value|| Procedure to retrieve (show) or get individual values from the multiple data type Hash Map key by splitting or breaking || next convert the key into vector.”