StackOverflow is a collaborative programming Q&A community venture
Note: The content of this blog is the opinion and thoughts of the blogger and does not necessarily represent the opinions of IDUG.
DB2 SQL convert decimal to character pad with zeros
How can I convert DB2 DECIMAL(11) from 12345678 to character value 00012345678
db2 hit Reason: Password expired. ERRORCODE=-4214, SQLSTATE=28000 even password is correct
I am running a maven program, and it involve connection to db. Here is part of my code of the database config:
I can login successful with the username and password, however, my program keep hitting the following error:
I also just change the db2 user password, also hit back this same error. I believe there is something wrong with my configuration, kindly advise.
SYSSEQUENCES in SYSIBM type *FILE not found Error
In my spring boot application i'm calling for AS400 DB according to following application properties
But when i'm running my application I'm getting following error.
What is wrong with my application? Is there something wrong in my application properties. In here i cannot do any changes from DB side. I have to work with already implemented DB. I cannot recreate DB from my jpa files. I have seen someone resolved this problem by changing following property
but in my scenario i cannot do it. please give me another solution.
Can't order query correctly
A while ago I requested help to code a LEFT JOIN filtering in a particular way that the result postition the desired value in the first row.
The thing now is that there are many cases which are mixing data. The scenario is that on the same table we have 2 values that we need to organize on different columns. The PO_ID is unique, but can have 1 or more values on the other tables, and for this particular case 1 PO_ID has 3 SHIP_ID_CUS values. We only need 1 PO_ID per row (no duplicates) that is way we used the MAX() and GROUP BY.
Here is a piece of the code that I think cause issues.
By searching that condition we get the following result
The problem is that if we search directly on the TABLE.D, the last event that we need (with last update record tms) is another one (X1) and somehow the date is incorrect.
What is even more weird, is that if we search for the ship_id_cus on the original query, we get the correct code but still with a wrong date...
I tried other logic changes like modifying the left joins to search on a subquery.
But this is also giving the same exact results by searching either by po_id or ship_id_cus
Any ideas or comment will be much appreciated.
Adding the result of the LEFT JOIN with the row_partition() including all the ship_id_cus for that po_id, and all the codes with the tms. None match here.
Based on all these, it should be the last ship_id_cus with X1 event/tms. If we exclude also the ones starting with 9, we would get the following result.
(I am not applying here ordering by ship_id_cus, which already described before that did not work either the way I implemented)
how to add local jar to maven project
I trying a small maven project, and I try to connect to db2 database, so I need the
I tried many method from internet but still fail, here is some of the method I tried:
But, I am still hitting could not load JDBC driver.
Extract resultset from stored procedure, in Java
I am executing a stored procedure in Java using the old school way:
I can retrieve the output columns, but the procedure also returns other results as part of cursor, which i can retrieve using :
My question is, can i retrieve both output and the cursor in the same statement ?Thanks,
DB2 connectivity from .NEt core 2.1
I'm trying to connect to a DB2 database from .NET core application. My code needs to run in PCF in Linux stack. However the code development and Jenkins build happen on Windows server. My problem is that for DB2 to work properly with .NET core we need to add separate reference for windows and separate reference in Linux. For windows it will be
and for Linux it will be
Now the question is how will I change the DB2 reference during the build time from windows to Linux?Also I have integration test that needs to be run after the build is completed. Since the Jenkins server is windows, post build, I need to have DB2 windows reference library and just before deployment I need to change it to Linux so that it can be deployed in Linux stack ?
How to join two tables without repeating the same rows for different values in table
+ ---+-----------+| id | country |+ ---+-----------+| 1 | India || 2 | Australia || 3 | Canada || 4 | France || 5 | Russia |+ ---+-----------+
+ ---+-------+------------+| id | user | country_id |+ ---+-------+------------+| 1 | Ojas | 1 || 2 | Raj | 1 || 3 | John | 3 || 4 | Robin | 2 || 5 | Mary | 5 || 6 | Kamal | 4 || 7 | Bipin | 5 || 8 | Rohit | 1 |+ ---+-------+------------+
+ -----------+---------------+-------+| country_id | country | user |+ -----------+---------------+-------+| 1 | India | Ojas || null | null | Raj || null | null | Rohit || 2 | Australia | Robin || 3 | Canada | John || 4 | France | Kamal || 5 | Russia | Mary || null | null | Bipin |+ -----------+---------------+-------+
Which Data Structure is appropriate for this scenario? [on hold]
Need to do this using C#.
Scenario:There are two tables (which we cannot join) from two different databases.
table1 has ID and STATUS columns. table2 also has ID and STATUS columns but with different STATUS values also this table has latest status values.
I have to select records from table2 with latest status values based on IDs from table1 and update the table1 with the selected latest status.
Here I have to maintain lists for IDs and STATUS values from two tables and need to do comparisons and update table1 records.
The records are in thousands. So how do we do it efficiently in C#?
Add SSL Server Certificate for DB2 in JDBC code
I am trying to access a DB2 instance via SSL port.I have the certificate that I need to access it.But I am not sure of the parameter that I need to add it to so that connection is successful.
The python code to connect to the same DB2 instance is this :
I would want to provide the DB2Certificate.arm as a parameter to the jdbc url , similar to the python parameter of SSLServerCertificate . How can I do this ?