varsha rao

Greenhorn
+ Follow
since Mar 06, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by varsha rao

Hey,

I have precisely done the same thing which you said. I also did some more research on this.

http://www.dbvis.com/forum/message.jspa?messageID=7512

You need to convert it to XMLType.

Unforunately this didnt work on Oracle10g .


Has someone tried the same on 10g?

Thanks
Hi ,

I have the following query

SELECT z.itr_sys_id,
(SELECT XMLElement("AMOUNT",XMLAgg(XMLElement("wmm_match_am", wmm_match_am)))
FROM wire_mti_match x
WHERE x.itr_sys_id = z.itr_sys_id
) AS Amount
FROM icms_transaction z


The result returned is as follows
--------------------------------------------------------------
156565 <AMOUNT><wmm_match_am>500</wmm_match_am><wmm_match_am>500</wmm_match_am><wmm_match_am>0</wmm_match_am></AMOUNT>


But when i do resultset.getString("Amount") , i get null
I am not able to read the result into an appropriate java object.

Could anyone help me with this please?

Thanks
Hi all,

I found a solution for this. In Java5.0 the Character class provides methods which will return the code point for a given char[] array

codePointAt(char[] a, int index) ;

Using this method we can get the Unicode for a String in any Language which can be displayed on the browser

// here is the method for the same "value" is the String in hindi (or any other) Language

public static String getUnicode(String value)
{

StringBuffer testBuffer = new StringBuffer();
char[] test = value.toCharArray();

if(test != null)
{
int size1 = test.length;


for(int j = 0 ; j < size1;j++)
{
testBuffer.append("&#");
testBuffer.append(Character.codePointAt(test, j));
testBuffer.append(";");
}


}

return testBuffer.toString();
}

This method will return you the correspoding unicode in dec which you can write to a properties file and use the samefor display

Reference : http://en.wikipedia.org/wiki/Unicode_and_HTML


Thanks
15 years ago
I am able to read the hindi code from the excel sheet , but i need to convert the hindi characters to the corresponding unicode.

My prog should read hindi code from excel and write the corresponding unicode to a properties file.


Excel sheet data Properties file data

पुन:आरंभ करें read this and write --> \u0905\u0928\u0941\u0930\u094b\u0927\u002


There is a tool called unipad which provides the unicode for hindi words but do we have any api's in java to use any such tool?

Is there any way for achieving this ?
15 years ago
HI ,

I have a requirement where i have to read hindi text from an excel sheet and write it onto a app_hi.properties file. The problem is in the hindi propeties file we need to have the unicode of the hindi word for it to get reflected on the screen and i am not able to do this. I am able to read the hindi text from excel but i dont know how to convert it to unicode. When i run mhy code in debug mode or try to print the hindi string , only a set of ??? are displayed.

Can anyone please help me with this.

I am not sure if this is the right forum for this question. Please let me know if i have posted it in the wrong place.

thanks
15 years ago
thanks a lot Marco . Just one more small help , do you have any code examples where JTA has been implemented. Do we need EJB's for JTA or can we implement it wihtout it.

Cheers
Varsha
16 years ago
Hi ,

Can anyone tell me if we have a rollback option for LDAP operations. my requirement is, whenever a i update a record in my oracle database, i need to migrate it to TDS as well. But if an exception occurs, the rollback should happen in both TDS as well as oracle .

My code outline is like this

Method a()
{
update in oracle
}

method b()
{
update in TDS
}

method c()
{

method a;
method b;

}

but if a NamingException occurs in method b , i have to roll back all the LDAP operations i performed there . Rolling back oracle operations is ok , but how do we roll back the LDAP operations.

Can someone help me with this.

Thanks

Cheers
Varsha
16 years ago
HI all,

I am trying to write the following query in hibernate

select * from TABLE where txn_id in (select max(txn_id) from TABLE group by
reference_id)

the corresponding criteria i have written is as follows

Criteria searchFormatCodes = session.createCriteria(B2bFormatsummaryTxn.class);

searchFormatCodes.add(Expression.eq("userId", userId));

DetachedCriteria dc = DetachedCriteria.forClass(B2bFormatsummaryTxn.class);
dc.setProjection(Projections.projectionList().add(Projections.max("comp_id.txnId")).add(Projections.groupProperty("comp_id.referenceId")));

searchFormatCodes.add(Subqueries.propertyIn("comp_id.txnId", dc));


but when i try to execute it i get the following error


Caused by: java.sql.SQLException: ORA-00913: too many values


How do i do the correct grouping using criteria's
Hi all,

I am new to Maven , i downloaded the zip file and followed the instructions given in th website, but when i run the command
mvn archetype:generate i get the following error. Any help or advice on this


C:\Documents and Settings\cm>mvn -e archetype:generate
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
-----------------------------------------------------
this realm = plexus.core
urls[0] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-2.0.9-uber.jar
urls[1] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/archetype-common-2.0-alph
a-3.jar
urls[2] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/archetype-common-2.0-alph
a-3-javadoc.jar
urls[3] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/archetype-common-2.0-alph
a-3-sources.jar
urls[4] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-ant-plugin-2.1.jar
urls[5] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-ant-plugin-2.1-java
doc.jar
urls[6] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-ant-plugin-2.1-sour
ces.jar
urls[7] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-archetype-creator-1
.0-alpha-7.jar
urls[8] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-archetype-creator-1
.0-alpha-7-javadoc.jar
urls[9] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-archetype-creator-1
.0-alpha-7-sources.jar
urls[10] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-archetype-plugin-2
.0-alpha-3.jar
urls[11] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-archetype-plugin-2
.0-alpha-3-javadoc.jar
urls[12] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-archetype-plugin-2
.0-alpha-3-sources.jar
urls[13] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-assembly-plugin-2.
2-beta-2.jar
urls[14] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-assembly-plugin-2.
2-beta-2-javadoc.jar
urls[15] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-assembly-plugin-2.
2-beta-2-sources.jar
urls[16] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-changelog-plugin-2
.1.jar
urls[17] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-changelog-plugin-2
.1-javadoc.jar
urls[18] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-changelog-plugin-2
.1-sources.jar
urls[19] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-changes-plugin-2.0
.jar
urls[20] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-changes-plugin-2.0
-javadoc.jar
urls[21] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-changes-plugin-2.0
-sources.jar
urls[22] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-checkstyle-plugin-
2.2.jar
urls[23] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-checkstyle-plugin-
2.2-javadoc.jar
urls[24] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-checkstyle-plugin-
2.2-sources.jar
urls[25] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-clean-plugin-2.2.j
ar
urls[26] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-clean-plugin-2.2-j
avadoc.jar
urls[27] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-clean-plugin-2.2-s
ources.jar
urls[28] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-compiler-plugin-2.
0.jar
urls[29] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-compiler-plugin-2.
0-javadoc.jar
urls[30] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-dependency-plugin-
2.0.jar
urls[31] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-dependency-plugin-
2.0-javadoc.jar
urls[32] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-dependency-plugin-
2.0-sources.jar
urls[33] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-deploy-plugin-2.3.
jar
urls[34] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-deploy-plugin-2.3-
javadoc.jar
urls[35] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-deploy-plugin-2.3-
sources.jar
urls[36] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-eclipse-plugin-2.5
.jar
urls[37] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-eclipse-plugin-2.5
-javadoc.jar
urls[38] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-eclipse-plugin-2.5
-sources.jar
urls[39] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-install-plugin-2.2
.jar
urls[40] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-install-plugin-2.2
-javadoc.jar
urls[41] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-install-plugin-2.2
-sources.jar
urls[42] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-jar-plugin-2.2.jar

urls[43] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-jar-plugin-2.2-jav
adoc.jar
urls[44] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-jar-plugin-2.2-sou
rces.jar
urls[45] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-javadoc-plugin-2.4
.jar
urls[46] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-javadoc-plugin-2.4
-javadoc.jar
urls[47] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-javadoc-plugin-2.4
-sources.jar
urls[48] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-scm-plugin-1.0.jar

urls[49] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-scm-plugin-1.0-jav
adoc.jar
urls[50] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-scm-plugin-1.0-sou
rces.jar
urls[51] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-source-plugin-2.0.
jar
urls[52] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-source-plugin-2.0-
javadoc.jar
urls[53] = file:/E:/VARSHA/Software/Maven/apache-maven-2.0.9/lib/maven-source-plugin-2.0-
sources.jar
Number of imports: 0
-----------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.apache.maven.plugins:mave
n-archetype-plugin:2.0-alpha-3:generate': Unable to find the mojo 'org.apache.maven.plugi
ns:maven-archetype-plugin:2.0-alpha-3:generate' in the plugin 'org.apache.maven.plugins:m
aven-archetype-plugin'
org/apache/maven/shared/invoker/MavenInvocationException
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin mana
ger executing goal 'org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-3:generate'
: Unable to find the mojo 'org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-3:ge
nerate' in the plugin 'org.apache.maven.plugins:maven-archetype-plugin'
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecy
cleExecutor.java:562)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(Defa
ultLifecycleExecutor.java:512)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecyc
leExecutor.java:482)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailur
es(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defaul
tLifecycleExecutor.java:227)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleEx
ecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j
ava:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.PluginManagerException: Unable to find the mojo 'org.a
pache.maven.plugins:maven-archetype-plugin:2.0-alpha-3:generate' in the plugin 'org.apach
e.maven.plugins:maven-archetype-plugin'
at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginMa
nager.java:618)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.
java:429)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecy
cleExecutor.java:558)
... 16 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: U
nable to lookup component 'org.apache.maven.plugin.Mojoorg.apache.maven.plugins:maven-arc
hetype-plugin:2.0-alpha-3:generate', it could not be created
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:
335)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:
312)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:
440)
at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginMa
nager.java:609)
... 18 more
Caused by: org.codehaus.plexus.component.factory.ComponentInstantiationException: Could n
ot instanciate component: role: 'null', implementation: 'org.apache.maven.archetype.mojos
.CreateProjectFromArchetypeMojo'
at org.codehaus.plexus.component.factory.java.JavaComponentFactory.makeException(
JavaComponentFactory.java:77)
at org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(Ja
vaComponentFactory.java:62)
at org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPlex
usContainer.java:1464)
at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponent
Instance(AbstractComponentManager.java:93)
at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(P
erLookupComponentManager.java:48)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:
331)
... 21 more
Caused by: java.lang.NoClassDefFoundError: org/apache/maven/shared/invoker/MavenInvocatio
nException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
at java.lang.Class.getConstructor0(Class.java:2640)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(Ja
vaComponentFactory.java:44)
... 25 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40 seconds
[INFO] Finished at: Sun May 04 02:28:10 PDT 2008
[INFO] Final Memory: 19M/52M
[INFO] ------------------------------------------------------------------------
16 years ago
Thanks but i have another doubt. On what factors should i decide the value of the maxActive and initialSize parameters for my application . Could you suggest on this. Our application can have at a time a max of 200 users logged on to it.
Hi ,

We are using a multi threaded approach wherein we are tyring to get connection from the datasource.

But the problem is when all the 12 threads try to get the conncetion at the same time from the datasource, the code is getting hanged. No exception is thrown . How do we solve this?

Is getting connections from a datasource advisable for a multi threaded approach or is there any better alternative?

Please suggest
hi every body ,
we have created an application using struts and we need to create help files for all the modules in the application . Can you please tell me if there is any way to do this in java ,are there any specific api's for it.
Please help me out.
18 years ago
No i have only jdk1.5 installed on my system,i don have any other versions on java. Still this is happening , i don know why
18 years ago
Thanks for telling me the required links, i tried out the following prg, but im getting UnSupportedClassVersionError exception while running the prg. Please tell me why this exception is coming and how to rectify it.

following is the prg

import java.io.*;
import org.apache.poi.hssf.usermodel.*;

public class XLTrial
{
public static void main(String args[])throws IOException
{
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");

// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow((short)0);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell((short)0);
cell.setCellValue(1);

// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
}


When i run the prg this is the exception im getting

Exception in thread "main" java.lang.UnsupportedClassVersionError: XLTrial (Unsu
pported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
18 years ago
hello
i have to design a Gui with some menus, each menu has an associated query. When user clicks on a menu , the associated query gets executed and the results are to be written in a XL sheet. How do i do this, i have to use JSP for the GUI . Can some one please help me out with this.
Its really urgent.
regards
Varsha
18 years ago