I am uploading an excel file which contains DB table. Then I insert those records into the DB table. What are the ways to verify whether all of them uploaded perfectly?
These are the approaches I tried
I already test the counts of excel file vs insert.
download the DB table as Excel and compare that excel with uploaded excel.
What are the other way to test?
You can read the file and create a file checksum and thus generate a hex value, then read the DB data create a hex and validate against the generated hex value.
i am a new user of Jackcess.
I use the addRowFromMap method for insert a new row in the MS Access table, but i can not to insert an image in it.
The table Column have the correct format but i can not to do that.
I try to insert java File format, java bytearray, but nothing to do.
Do you have any suggestions or a documentation link ?
Thanks in advance, Emiliano
Runnning sql query to export the contents to CSV file i notice that certain columns do not get displayed properly.in my cast date timestamp is not properly displayed in cell
Code as below :
COPY (select hostname as "Host Name",devicetype as "Device Type",platform as "Model",Ipaddress as "IP Address",swversion as "Software Version",configuredTime as "Configured",activeTime as "Active",cluster as "Clusters",location as "Location",macaddress as "Mac Address",devicepool as "Device Pool" from (select getmodelinfo.ipaddress,max(getmodelinfo.hostname) as
hostname, max(getmodelinfo.macaddress) as macaddress,
max(getmodelinfo.devicetype) as devicetype,
max(getmodelinfo.platform) as platform,
max(getmodelinfo.swversion) as swversion, min(getmodelinfo.day_end_date) as configuredtime,
max(getmodelinfo.active_end_date) as activetime,
max(getmodelinfo.ucmclustername)
as cluster, max(getmodelinfo.ucmlocation) as location,
max(getmodelinfo.ucmdevicepool) as devicepool from (select
pcwh_inv.uniquedeviceid,pcwh_inv.ipaddress,
pcwh_inv.endpointmodel, pcwh_inv.hostname, pcwh_inv.devicetype, pcwh_inv.platform,
pcwh_inv.macaddress, pcwh_inv.version as
swversion,pcwh_inv.deployed_day_end_date as day_end_date,
pcwh_inv.lastupdated_day_end_date as active_end_date,
pcwh_inv.ucmclustername,pcwh_inv.ucmlocation,pcwh_inv.ucmdevicepool
from pcwh_inventory_20160410 pcwh_inv,
(select pcwh_inv.uniquedeviceid, max(pcwh_inv.lastupdated_day_end_date) as
lasttime from pcwh_inventory_20160410 pcwh_inv where pcwh_inv.ipaddress
notnull group by
pcwh_inv.uniquedeviceid)gettime where pcwh_inv.endpointmodel = 'SX' and
pcwh_inv.uniquedeviceid = gettime.uniquedeviceid and
pcwh_inv.lastupdated_day_end_date = gettime.lasttime and pcwh_inv.mgmtstatus not in ('Deleted')
)getmodelinfo group by ipaddress) M) TO '/opt/emms/emsam/export/raj2.csv' DELIMITER ',' CSV HEADER
Please find below screenshot of the result I get on running query without exporting to csv , on export to csv (image below) , image of cell content when i click on particular row content it shows correctly though(bottom most image)
It seems to me an issue with formatting csv file could you please let me know how I could do this from query level to display exact contents as in db column?
I believe nothing is wrong with your code, but that Excel is treating that column as something other than a date, this happens often. It can be resolved by selecting all of the affected cells, right clicking, and changing the format to text through the subsequent menus.
If this CSV is going to be manipulated further by another application, I don't think you will have an issue, as the data is seemingly fine.
If for whatever reason you need it to be correctly displayed in Excel dynamically, you may need to look into something like this.. Java - Excel Cell Type
The problem is straight forward there is no error with CSV format.Actually the data entries done by you are in the wrong way u can't have a space in a data entry that will cause a problem.
So in the 6th and 7th column u can see there is a space between the data entries so due to which problem is taking place.
To prevent that just add a new column for date.
It will solve all the problems and the data will be entered in your database.
I have an Excel sheet with 200+ column names and each column has a header name. I have to fetch all the header names first from the Excel sheet using Java and pass them into Oracle DB. The DB returns only a few header names, say 150, which I need to insert into a table.
My problem is that I am unable to fetch the specific header names (150 out of 200) from the Excel sheet and their values to insert into db.
I tried using a CSV file but it cannot fetch specific column values. Please suggest any solution that I need to follow here.
1) Have you tried to read the csv file like regular text file, then extract the first line, the header row, into a String? Then separate the string by "comma" and you should have an array of string with column headers.
2) Make sure you don't have any "unusual" characters such as "dash", "comma", "quote" in your column header description.
Gook Luck
I have an Excel sheet in which 2 columns have a dropdown with one about 4-5
values and the other with 2 values that can be selected. I would like to read
the value that is there for each row in these two columns. . What is the code
sample to do that? I did browse a while on the net and this forum, but did not
find any answers. I posted in the JExcel Yahoo groups , but no success.
I have added the following code, but this does not help. This code sample just prevents the "common Assertion failed" error
WorkbookSettings settings = new WorkbookSettings();
settings.setSuppressWarnings(true);
Workbook workbook = Workbook.getWorkbook(sis, settings);
The sheet gives an erroneous row count when the dropdown is there. Has anyone been able to read the values selected in the drop down ?
If you have applied an autofilter to your Excel sheet then probably that is responsible for the issue. I would suggest you to please remove the autofilter and then try fetching the value of the combobox.
Cell yourCell = yourSheet.getCell(x,y);
String comboboxValue = yourCell.getContents();
logger.log("value selected in combobx is : " + comboboxValue );