Win a copy of Rust Web Development this week in the Other Languages forum!

Rj Vasanth kumar

Greenhorn
+ Follow
since Aug 30, 2009
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 Rj Vasanth kumar

I have to store data of size more then 3000 characters. Is it better to store into database fields directly?
or store it as a BLOB OR CLOB data in db fields?

I may update the data frequently.

Is it efficent if i keep those data in xml file and store it in location of web server? so that i read xml file everytime.

Kindly provide solution for this and minimal database communication.

Thanks
Vasanth
When i execute the hibernate code for retrieving the data getting exception.
DB: MySQL5

org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
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.custom.CustomLoader.list(CustomLoader.java:103)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1333)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:146)
at test.Example.main(Example.java:20)
Caused by: java.sql.SQLException: Column 'id0_' not found.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1060)
at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2694)
at org.hibernate.type.IntegerType.get(IntegerType.java:26)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:77)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:68)
at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:650)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:277)
at org.hibernate.loader.Loader.doQuery(Loader.java:384)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:203)
at org.hibernate.loader.Loader.doList(Loader.java:1499)
... 5 more
00:58:12,406 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/G:/Hibernate/hibernate/hibernate/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
Hibernate: select name from hiber as h
00:58:13,062 WARN JDBCExceptionReporter:57 - SQL Error: 0, SQLState: S0022
00:58:13,062 ERROR JDBCExceptionReporter:58 - Column 'id0_' not found.

Java Source :

List list =session.createSQLQuery("select name from hiber as h").addEntity("h", Hiber.class).list();
Iterator itr = list.iterator();


Kindly provide the solution for this

Your's
CATALINA_HOME=D:\Alternate_C_Drive\apache-tomcat-6.0.16



Regards
Vasanth.
12 years ago
Hi
Look this code. Removes the duplicate and returns List object.

org.apache.commons.collections.list.SetUniqueList is from apache common-collection API.

List list =new ArrayList();
list.add("ONE");
list.add("ONE");
list.add("TWO");
list.add("TWO");
Set set = new HashSet();
List l = SetUniqueList.decorate(list);
System.out.println(l);



Regards
vasanth
12 years ago
Hi
I have a problem while access my web application through the context path.

I have added the datasource resource with that context. The datasource JNDI works fine and
problem is if try http://localhost:8080/test i cant get into that page.

Kindly give the solution for the context path.

I have written Context xml like this
path : CATALINA_HOME/conf/Catalina/localhost/
file name : myapp.xml

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/test" docBase="myapp">
<Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="user password="password" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/myapp?autoReconnect=true"/>
</Context>

Thanks
Vasanth
12 years ago