dileep keely

Ranch Hand
+ Follow
since Jun 28, 2010
Merit badge: grant badges
For More
Bangalore
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by dileep keely

Ritchie-
Can you please provide me a hint on what is the best way?
7 years ago
The requirement.
Database containing thousands of records, instead of making the user wait till entire record set is fetched from a data store, the data should be pushed to the browser as and when the record is fetched and immediately rendered on the browser.
What is the best way in JAVA.

My approach.
Task--Create Java Thread 1 -> Hit DB, get the records say 1000 at a time. Iterate through the list, Place every record in messageQueue for reliability of the record and send it to HTML browser through event handler.Once the count is reached, hit DB again and fetch 1000 records.

7 years ago
The requirement.
Database containing thousands of records, instead of making the user wait till entire record set is fetched from a data store, the data should be pushed to the browser as and when the record is fetched and immediately rendered on the browser.
What is the best way in JAVA.

My approach.
Task--Create Java Thread 1 -> Hit DB, get the records say 1000 at a time. Iterate through the list, Place every record in messageQueue for reliability of the record and send it to HTML browser through event handler.Once the count is reached, hit DB again and fetch 1000 records.

7 years ago
I am able to do compile time weaving, but is there any way to avoid ant task executions.
We are told not to use any ant related tasks in our projects..
I want to avoid ant.taskdef
ant.aijc calls from Gradle task. The aspect plugin support is not available in Gradle with higher version.
Below is the code I have written but with ANT  task in it.please suggest me.


7 years ago
Please suggest.
My XML data :
<XML>
<LogLevel>info</LogLevel>
<Content>
<Msg>
<AccountNo>6666</AccountNo>
<ApplName>Testing</ApplName>
</Msg>
</Content>
<data><AccountNo>555555</AccountNo></data>
<AccountNo>444444444</AccountNo>
<Date>20140909</Date>
</XML>


I want to mask all the AccountNo to the output as below.

<XML>
<LogLevel>info</LogLevel>
<Content>
<Msg>
<AccountNo>******66</AccountNo>
<ApplName>Testing</ApplName>
</Msg>
</Content>
<data><AccountNo>******5555</AccountNo></data>
<AccountNo>******444</AccountNo>
<Date>20140909</Date>
</XML>



Java code :




XSLT : I am not good at XSLT i am learning it.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>

<!-- identity transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="AccountNo">
<xsl:variable name="acct-num" select="substring-before(substring-after(.,'AccountNo'), '/AccountNo')" />
<xsl:value-of select="concat('************', substring($acct-num, string-length($acct-num) - 2))" />

</xsl:template>

</xsl:stylesheet>

Could you please let me know what should be the XSLT..

I am getting wrong output :

<?xml version="1.0" encoding="UTF-8"?>
<XML>
<LogLevel>info</LogLevel>
<Content>
<Msg>************<ApplName>Testing</ApplName>
</Msg>
</Content>
<data>************</data>************<Date>20140909</Date>
</XML>
In my Restful service application I get XML data ..which we log it into a log file.
I want to mask the accountNumber before I log the input XML request to a log file.
Also, to log the response xml data ..

Could you please let me know the best way?
Note : We have different Services which we expose to the client

1.I am thinking of using SAX parser and then when I encounter the element <accountNUmber> I wil call the logic which mask the account number.
And return the StringBuffer. (In future may be <depositaccountNumber>, <phonenumber>or <FaxNumber>)..

2. I don't want to go with the Xpath , I use spring Aspect doBefore() where the above logic goes..We expose different services.

9 years ago
Jeanne,
I need to interact with all those 15 tables out of 19tables , I am already loading the other 4 tables which are static during the run time.
I can join some of the tables but the problem is that we need to map them to the nested classes.
I have wrote a custom mapper by extending the beanpropertyrowmapper. BUt not sure to what extent it could help me. I am going
to try that tomorrow.
9 years ago
Could you please let me know on the below.
I have 15 database tables with corresponding java classes from which I need to pull data and show it to the REST client. We are using spring-jdbc without any ORM..
I am using BeanPropertyRowmapper to map the database values with the corresponding variables defined in java classes.
As a result there will be 15 Database hits..
I know its a bad practise and performance hit. could you suggest me..(only spring-jdbc i should use)
9 years ago
As the complete xml was stored at our end my idea was to map it the <xsd:String> in schema.
Our team and clients is not listening to my suggestion .,So Im modifying the schema design from <xsd:String> to relavent elements corresponding to the XML elements (clob in Database).
Then I would pull xml data from DB and Unmarshal it and then Marshal it back while sending response to client..
I think its a weird way as we already have the xml data and we are playing back and forth but Im with no luck..

Thanks Paul and Bill.
9 years ago
Thank you Paul,

Could you please let me know the best way that the clients can Unmarshall the XML data which has xml elements inside CDATA section(Whose xsd: type element in String in my case)..
Example:
<service><test1>test</test1> <CDATA[<test2>test2</test2 <test3>test3</test3>>]></service>

Would it be like splitting the <test1> a part and the test2 and unMarshal those elements in CDATA.

Because from the client end they want the elements in CDATA section to be Unmarshalled to respective JAXB Objects. Not the complete CDATA to String Object.

In case of any best parsers Please let me know I will research more mean while.
9 years ago
REST service..
I have the xml content as CLOB in database and I need to send it to the rest client. I have corresponding element whose data type is defined as String. <xsd:String> in schema to which
I will be mapping the CLOB data obtained from DB.
I am able to map the CLOB data to xsd:String data type, but CDATA[] would be prefixed to the response when marshalled by JAXB during conversion which is the usual behavior.
But clients don't want the CDATA to be present while sending the response.
<CDATA[
<ns1:updateDetails>
<address>
</address>
</ns1:updateDetails]]>


Could you please suggest me how should I resolve.
9 years ago
I got your point
I want to load all the xml data and its attributes at runtime and be utilized across the application..so thats the reason for static.... I will use SAX parser and and populate those objects into a static map thats the way I would think of..
so, basically I have a xml which I want to umarshall using JAXB.
If I dont include the static fields or property I am able to set . I went through documentation where it was stated that static fields or static property cannot be binded using JAXB.

The reason Im focused on static is that I would be setting those data at runtime and will use across the application.(serve all the clients)

XML :





JAVA:





Please let me know your thoughts on how to set the static Map

Its works fine without static..
Could you please tell me if we can wrap few columns to wrapText(true) and few columns to wrapText(false) in java using POI jar.
Example : I want first three columns to be wrapped and rest to be left as it it.
I tried but with no luck..



Please provide me a clue..
9 years ago
I completely remvoved query=false/anything in the same lines...I did fine tune my code and here is how it looks now.. It works now..Although Iam testing it now..Please let me know in case of any pitfalls in this..