Deepak Ram

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

Recent posts by Deepak Ram

Sorry for the last post. THe tags got removed. What I meant was please try removing the break statements in the line 62. Please try the same to see if it works.

Apologize for the formatting in the last post.
11 years ago
JSP
There is a
statement at the end of the <tr> statement. Please try after removing the
tag.

Line 62: "</tr>
",

Hope this works.
11 years ago
JSP
Hello,

Please let me know what is the desired output. Is it "is the language Java"???

The issue with the code here is the line:

int last = s.indexOf("");

This returns 0. This is because the output of the line

String s = kb.next(); is Java and this does not contain any "".

Hence, when you do a substring from 0 to 0, you do not get anything in the output.

Hope this helps.

11 years ago
Hello,

I am having a strange issue in generating response XMLs using Spring WS.

I use Spring WS with JAXB. PFB a snippet of the schema that I used to generate JAXB objects:

<xs:complexType name="Customer">
<xs:sequence>
<xs:element name="Accounts" type="Accounts" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Accounts">
<xs:sequence>
<xs:element name="Account" type="Account" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Account">
<xs:sequence>
<xs:element name="Account" type="xs:string" />
</xs:sequence>
</xs:complexType>


The expected output should look something like this:

<Customer>
<Accounts>
<Account>
<Name>xyzxxx</Name>
<Account>
<Account>
<Name>xasde</Name>
<Account>
<Accounts>
</Customer>

This is working in case of small XML requests. But, in case of huge XML requests, the output is modified to something as follows:

<Customer>
<Accounts>
<Account>
<Name>xyzxxx</Name>
<Account>

<Name>xasde</Name>

<Accounts>
</Customer>

The difference is that the account tag is not getting generated in a few cases. This is not happening regularly but intermittently. As a result, the XML formed does not conform to the schema and we are getting schema validation errors.

As I mentioned before, this issue occurs only in case of huge XMLs. I might say that the size of the XML is greater than 500 kb each time we encounter this error. Also, we are not able to reproduce this on a regular basis.

Has anyone encountered this error before? Or any suggestions as to what might cause this error? Or any workaround for this issue?

Any thoughts would be helpful and will be highly appreciated.

Thanks.
12 years ago
I try to connect to a Sybase server from my machine.

When I do a direct connection from Java, I am able to connect to the Sybase server.

Also, when i configure it as a ODBC connection, and try to do a Test Connection, the result is successful.

But, when i try to configure it as a Datasource in WAS server, i am getting the error message " java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s)."

My WAS version is 6.1.

What could be the possible reasons for this?

I checked my user id and password supplied to WAS and it is correct.

My question is, when I am able to connect through ODBC, why am I not able to connect to the Sybase sever as a Datasource from WAS?

Please help me out....
16 years ago
I want to use TRIM function in my HQL. This is the query in SQL form:

select A.CODE, trim(A.DSCR) from CODETABLE A where (A.CONDITION='100') order by trim(A.DSCR)

I want to write this query in HQL. This is my code in Hibernate:

StringBuffer qryStr = new StringBuffer();
qryStr.append("Select A.CODE, trim(A.DSCR) ");
qryStr.append("from CODETABLE A ");
qryStr.append("WHERE A.CONDITION = '100' ");
qryStr.append(" ORDER BY trim(A.DSCR)");
Query qry = session.createQuery(qryStr.toString());

List lst = qry.list();

When the query is executed, Hibernate throws the exception listed below.

Please let me know what mistake I am committing here in the usage of the TRIM function. My query runs fine without the TRIM function.

I am using DB2 and Hibernate 3.0 and the dialect is DB2390Dialect.

org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:59) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:1502) at org.hibernate.loader.Loader.list(Loader.java:1482) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:365) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:268) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:782) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) at com.met.us.aoc.dao.AOCUtilityDAO.getPaymentTypes(AOCUtilityDAO.java) at com.met.us.aoc.struts.action.AOCSearchTabAction.execute(AOCSearchTabAction.java:81) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478) at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811) at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394) at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213) at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:782) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510) Caused by: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL0214N An expression in the ORDER BY clause in the following position, or starting with "1" in the "ORDER BY" clause is not valid. Reason code = "2". SQLSTATE=42822 at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source) at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source) at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(Unknown Source) at COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(Unknown Source) at COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery(Unknown Source) at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteQuery(WSJdbcPreparedStatement.java:878) at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeQuery(WSJdbcPreparedStatement.java:559) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:107) at org.hibernate.loader.Loader.getResultSet(Loader.java:1183) at org.hibernate.loader.Loader.doQuery(Loader.java:363) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:203) at org.hibernate.loader.Loader.doList(Loader.java:1499) ... 32 more
Hello,

I have a problem in ApplicationResources.properties file. I have a custom taglib created which will format the number in a given format. I have added the following line in my ApplicationResources.properties file.

com.test.message=This number is to be formatted: <test:formatCur>{0}</test:formatCur>

where <test:formatCur> is the custom tag that is created to format the number.

I have added this as a ActionMessage in the Action class as follows:

actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("com.test.message"));
saveMessages(request, actionMessages);

And in the JSP, I have added the following code:

<html:messages id="message" message="true" >
<bean:write name="message" filter="false"/>
</html:messages>

But, my number is still not getting formatted. The class that I use for formatting is not invoked at all.

I have tried with filter=true and still, it doesnt work.

Am I missing something here? Please help.

Thanks in Advance,
Deepak.
16 years ago
Hello,

I have a very unique problem in Hibernate. I will try to explain the problem as clearly as possible.

I have a table A which has three columns 1, 2 and 3. These 3 columns are nullable columns.

I have a table B which has fields 4 and 5 as its compund key. Now, the table A has a foreign key relationship with table B through fields 1 and 4 and also 2 and 5.

I have another table C which has fields 6 and 7 as its compond key. The table A has a foreign key relationship with table C through fields 3 and 6 and also 2 and 7.

Now, my problem is since the field 2 in table A is related to both Table B amd table C, Hibernate is not allowing me to use insert=true and update=true for the relationships of table A and B and table A and C. If i do so, then at startup, hibernate throws me an error to set either one of the relationships as false. If i set either one of the relationships as false, then i am not able to update the database with the required value since I am explicitly setting the insert and update as false.

I need to update fields 1, 2 and 3, but the relationships is not allowing me to do so. Please let me know what can be done for the above issue.

I tried using native SQL to update the tables. But I got an exception saying that only HQL should be used for insert/update.

Please let me know if there is any other way.
Hello,

I have a very unique problem in Hibernate. I will try to explain the problem as clearly as possible.

I have a table A which has three columns 1, 2 and 3. These 3 columns are nullable columns.

I have a table B which has fields 4 and 5 as its compund key. Now, the table A has a foreign key relationship with table B through fields 1 and 4 and also 2 and 5.

I have another table C which has fields 6 and 7 as its compond key. The table A has a foreign key relationship with table C through fields 3 and 6 and also 2 and 7.

Now, my problem is since the field 2 in table A is related to both Table B amd table C, Hibernate is not allowing me to use insert=true and update=true for the relationships of table A and B and table A and C. If i do so, then at startup, hibernate throws me an error to set either one of the relationships as false. If i set either one of the relationships as false, then i am not able to update the database with the required value since I am explicitly setting the insert and update as false.

I need to update fields 1, 2 and 3, but the relationships is not allowing me to do so. Please let me know what can be done for the above issue.

I tried using native SQL to update the tables. But I got an exception saying that only HQL should be used for insert/update.

Please let me know if there is any other way.
Yes. It is being supported only for IE browsers. But the problem is between the two versions of IE.
I have a problem in sorting. I have a table and the first column of all the tbody rows in the table has a checkbox. All the check boxes in the table will be checked by default when the page is loaded initially. I have a sorting functionality. When i try to sort the table, if any check box is unselected, the check box gets selected automatically. The command used for inserting the rows in the table is

table.tBodies[0].appendChild(<<innerHTML of the row>> ;

When i see the innerHTML of the row, the property of the checkbox is unselected. But after the execution of the above command, the checkbox gets selected automatically.


The strange part is this scenario happens only in IE 6. The functionality is working as expected in IE 7.

Has anybody faced this issue before? If so, any solution for the above.
17 years ago
I have a problem in sorting. I have a table and the first column of all the tbody rows in the table has a checkbox. All the check boxes in the table will be checked by default when the page is loaded initially. I have a sorting functionality. When i try to sort the table, if any check box is unselected, the check box gets selected automatically. The command used for inserting the rows in the table is

table.tBodies[0].appendChild(<<innerHTML of the row>> ;

When i see the innerHTML of the row, the property of the checkbox is unselected. But after the execution of the above command, the checkbox gets selected automatically.


The strange part is this scenario happens only in IE 6. The functionality is working as expected in IE 7.

Has anybody faced this issue before? If so, any solution for the above.