charulatha Ramalingam

Greenhorn
+ Follow
since Dec 05, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by charulatha Ramalingam

Hi Team
I have a json array like below

{
"retcode":"0",
"transDetails":[
{
"date":"03/20/2006",
"amt":"200"
},
{
"date":"03/20/2006",
"amt":"300"
},
{
"date":"03/20/2006",
"amt":"400"
},
{
"date":"03/20/2006",
"amt":"200"
}
]
}
]

Please help me to take the last element from this array transdetails.
and also i need to reverse this transdetails

Thanks
CR



}
1 year ago
Hi Team

I am new Java and Json .
 
I have requirement that i will get one response as json format  which attributes cannot be same all the time , so i couldnot create POJO class for all the attributes, so used @JsonAnySetter Property and JSONNODE to hold the nested attributes.. I am able to set the json in java object as expected.
But i am not sure how to iterate my output and get the individual object values.

code snippet is given below


output :
I need to iterate this output and set the value in pojo class which i am not able to do.


Please help me in moving forward


Thanks in Advance
1 year ago
Hi All,

I am new to Java webservices and Aws lambda function,

I have a requirement to create soap webservice in lambda function with java.
I heard Aws supports only REST API, But I need to create soap webservice.
Some one please guide me with any samples or link to heads up.


Thanks in Advance
1 year ago
I am developing one soap webservice.I got the following exception when I tested the webservice from websphere server when some custom exception is thrown from the webservice.
java.lang.ClassCastException: com.ibm.xml.xlxp2.jaxb.JAXBContextImpl incompatible with com.sun.xml.bind.api.JAXBRIContext.
Please help me with how to resolve the issue.
10 years ago

Hi Team,
package com.cc.apps.vv.main;

import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Map;
import com.healthmarketscience.jackcess.Column;
import com.healthmarketscience.jackcess.Cursor;
import com.healthmarketscience.jackcess.Database;
import com.healthmarketscience.jackcess.Table;
import com.ibatis.sqlmap.client.SqlMapExecutor;
import com.xx.apps.yy.model.Login;
import java.sql.*;
public class Test {

public static void main(String args[]) throws IOException, SQLException{
Table table = null;
Database db = null;
Login login = null;
ArrayList<Login> rowList = null;
Connection con = null;
Statement st = null;
try {
rowList = new ArrayList();

db = Database.open(new File("C:\\Users\\tt\\Accdb.mdb"));

table = db.getTable("Access");

for(Map<String, Object> row : table) {
login = new Login();
if(row.get("P_ID")!=null){
login.setPId(row.get("P_ID").toString());
}
if(row.get("R_ID")!=null){
login.setRId(row.get("R_ID").toString());
}if(row.get("LNumber")!=null){
login.setLocNum(row.get("LNumber").toString());
}
rowList.add(login);
}

login.setRowList(rowList);
Class.forName("com.ibm.as400.access.AS400JDBCDriver");
con = DriverManager.getConnection(
"jdbc:as400://system-name/default-schema", "aa",
"bb");

con.setAutoCommit(false);
st = con.createStatement();
String insertTableSQL = "INSERT INTO Master (P_ID,R_ID,LNumber) VALUES (?,?,?)";
PreparedStatement preparedStatement = con.prepareStatement(insertTableSQL);
preparedStatement = con.prepareStatement(insertTableSQL);
for(Login login1 : rowList)
{
preparedStatement.setString(1, login1.getPId());
preparedStatement.setString(2, login1.getRId());
preparedStatement.setString(3, login1.getLocNum());
preparedStatement.addBatch();
preparedStatement.executeBatch();
}


con.commit();
} catch (ClassNotFoundException e) {
try {
con.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}
}
}
The above code will do

1. Read the rows from the access table using jackcess
2.And add the row object to the list.
3Then I have connect the As400 database and batch insert the list values in Master table.

when i run this program am getting following error

Exception in thread "main" java.sql.SQLException: [PWS0082] library(s) not added to the library list.
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:703)
at com.ibm.as400.access.AS400JDBCConnection.setServerAttributes(AS400JDBCConnection.java:4122)
at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:3346)
at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:3216)
at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:3209)
at com.ibm.as400.access.AS400JDBCDriver.prepareConnection(AS400JDBCDriver.java:1411)
at com.ibm.as400.access.AS400JDBCDriver.initializeConnection(AS400JDBCDriver.java:1248)
at com.ibm.as400.access.AS400JDBCDriver.connect(AS400JDBCDriver.java:389)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)

I need to do sample batch insert in as400 table.
Please help what mistake am doing .

Thanks in Advance





Hi this is the sample piece used jackcess to access the .mdb file and display the table data
public class Test {
public static void main(String args[]){
try {
System.out.println(Database.open(new File("\\\\aa.bb.com\\root\\Java\\access.mdb"))
.getTable("MASTER").display());
} catch (IOException e) {
e.printStackTrace();
}

}
}

Is there any code is available to display only one particular row based on condition like how do we display using sql where condition using jackcess.
I am using jackcess1.2.8 jar

Thanks in Advance
Actually thing is there was no JdbcOdbc bridge driver installed on linux. thats why the UNC reference in the url will not work on linux.
This was the reason given by production team.
10 years ago
The calling webservice is consuming my WS .In this case how to find what kind of input the calling webservice will send to my WS.
10 years ago
I am developing one websevice whcih receives message from another webservice.
I have the wsdl file of the calling webservice
How I can I find what type of message the calling webservice will send to my webservice
10 years ago
Thanks Dude.

since am very new to linux environment. It will be very helpful if you could explain in detail what i can do inorder to acheive this in linux environment.
Whether to go with jackcess library will be correct choice. This issue is happening while deploying the project in linux environment in production and also was asked to solve it in java side itself.
Hope am making you all clear about my problem.

Thanks in Advance
10 years ago
Hi Team,


The above code is sample piece which would connect to the Access DB which .mdb file is in the remote folder and execute a simple query and retrieve some sample data.This works fine in Windows. but in linux we are not able to access the remote .mdb file.
Please help me in resolivng this issue in java side.
Heard We could use jackcess library it will access an Access DB through a direct API.
Please Explain howcome jackcess help in resolving my issue.

Thanks in Advance
10 years ago
Hi Team
I am new to spring and spring batch
I have a requirement to use spring batch to acheive the below things
1.Poll a mail box at regular intervals.
2.Whenever there is a new email in Inbox, irrespective of subject or attachment, place the attachment(if present) in the email into a folder path.
3.Write the details (Time, name of file) into a control table.

I could find many example in javamail api but couldnot find it using springbatch.
Please help me with some sample to acheive it or should i go to spring integration.

ThanKs
C
11 years ago
Hi Team

I am new to this spring . hope to get solution for my issue as it is stopping my work for a day.
When i click the file upload button i have to display the progressing bar til the file is uploading. - this is my requirement

My problem is am able to upload a file without calling show progress bar function. but if i am using the showfunction am getting the " Required MultipartFile parameter 'additionalFile' is not present error in my console" though i have configured The Multipart resolver in xml.

So I am trying to write the fileUploader controller.


@RequestMapping(value = /uploadFile.action, method =
{ RequestMethod.POST })
@ResponseBody
public String save(@RequestParam(required = false, value = "file") final MultipartFile file,
@RequestParam(value = "nor", required = true) final String no, final ModelMap model)
{
final int no = Integer.parseInt(no);

try
{
if (!DataUtility.checkFileSize(file))
{
return "Error";
}
return some thing; }
catch (final Exception ex)
{
model.put("errorMsg", getMessageFromProperties(ex.getErrorCode(), null));
}
return null;
}

In JSP:


<div id="cdd" class="jjjt" style="display: none;">
<div class="popupTitle"><span><spring:message code="PLEASE_WAIT"/></span></div>

<div id="abc" style="padding-top: 10px;"></div>
<div style="padding-left: 40px;">
<div class="progressBar">
<div class="determinateProgress"></div>
</div>

</div>
</div>

<input type="file" name="file" id="file" class="fileInput" />

if (document.form.file.value != '') {
var dotPosition = document.form.file.value
.lastIndexOf('.');
var fileExtn = document.form.file.value.substring(
dotPosition,
document.form.file.value.length);
if (fileExtn == '.pdf' || fileExtn == '.doc') {
//document.body.style.cursor = 'wait';
showProgress('please wait');
$.ajaxFileUpload({
url : "uploadFile.action",
type : 'POST',
fileElementId : 'file',
cache : false,
data : {
no : no
},
dataType:"text",
success : function(response) {
closeProgress();

},
<script>
function showProgress(progressMsg) {
document.getElementById("abc").innerHTML = "";
document.getElementById("abc").innerHTML = progressMsg;
var dd= document.getElementById("cdd").innerHTML;
$(".jjj").colorbox({
html:dd,
'open':true,
width : "380px",
height : "200px",
maxWidth:"380px",
maxHeight:"600px"
});
document.getElementById("cboxClose").style.display = "none";
}

function closeProgress(){
$.fn.colorbox.close();
}


</script>

what am missing am not able to find it .

please help.

Thanks in advance
11 years ago