anji anjaiah

Greenhorn
+ Follow
since Jul 24, 2013
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by anji anjaiah

Dear experts

I want develop backend rest serverices and backend system .

Please suggest me ,

My requiremnt ,alreday developed mobile application (let us say what's up like app)

i) i need to store chat information like text,videos and images

ii)Which is best way store the above data either any relation db or monog DB ?
please suggest which is best for storing data for the above question
iii)which server is best for processing for mobile rest services purposes (here rest services means chat mobiel application)
please suggest the server

TQ
Anji
8 years ago
Dear experts

I want develop backend rest serverices and backend system .

Please suggest me ,

My requiremnt ,alreday developed mobile application (let us say what's up like app)

i) i need to store chat information like text,videos and images

ii)Which is best way store the above data either any relation db or monog DB ?
please suggest which is best for storing data for the above question
iii)which server is best for processing for mobile rest services purposes (here rest services means chat mobiel application)
please suggest the server

TQ
Anji
8 years ago
Dear experts

I want develop back end rest services and backend system .

Please suggest me ,

My requirement ,already developed mobile application (let us say what's up like app)

i) i need to store chat information like text,videos and images

ii)Which is best way store the above data either any relation db or monog DB ?
please suggest which is best for storing data for the above question
iii)which server is best for processing for mobile rest services purposes (here rest services means chat mobile application)
please suggest the server

TQ
Anjaiah M
8 years ago
Thanks Jeanne i sloved my issue. thanks very much
8 years ago

Thanks Jeanne , now i am able to get all customer information ,but any restriction is there in In() Operator ,can take 1000Plus customer details in side the In() Operator ?

Ex:SELECT * FROM problems WHERE PROBLEM_ID IN(1,2,3,4,5,6,7,.......998,999,1000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999) any limit is there in JdbcTemplate obj?
8 years ago

Hi Jeanne,

What is difference between query VS namedParameterJdbcTemplate.queryForList


<


Thanks
Anji

8 years ago

HI Jeanne,

Thanks for your reply, please find the below code(ProblemInfoMapper).

class ProblemInfoMapper implements RowMapper<ProblemsDTO>{
public ProblemsDTO mapRow(ResultSet rs, int arg1) throws SQLException {
ProblemsDTO pDTO=new ProblemsDTO();
pDTO.setProblemId(rs.getInt("PROBLEM_ID"));
pDTO.setProblemName(rs.getString("NAME"));
pDTO.setProblemOutput(rs.getString("OUTPUT"));
pDTO.setProblemInput(rs.getString("INPUT"));
pDTO.setProblemDescription(rs.getString("DESCRIPTION"));
pDTO.setProblemTimeLine(rs.getInt("TIMELIMIT"));
pDTO.setProblemInsertDate(rs.getDate("PROBLEM_INSERT_DATE"));
pDTO.setProblemInsertTimestamp(rs.getTimestamp("PROBLEM_INSERT_TIME"));
return pDTO;
}
}

Thanks
Anji
8 years ago
HI All,

Note : I am using select query with In operator (EX: SELECT * FROM problems WHERE PROBLEM_ID IN(:PROBLEM_ID))
In Spring JDBC template i am unable get all customers information ,i am getting only one customer details

Please note :In() it is contains around 5 Customer Id (1,3,4,5,2) but i am getting only one customer details here i am getting only first customer information .

Code
List<ProblemsDTO> listOfProblmes=new ArrayList<ProblemsDTO>();
try {
JdbcTemplate jdbcTemplate=new JdbcTemplate(dataSource);
NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate);
MapSqlParameterSource parameters = new MapSqlParameterSource();
parameters.addValue("PROBLEM_ID", Arrays.asList(1,2,4));
listOfProblmes = namedParameterJdbcTemplate.query(AspPortalConstants.GET_PROBLEMS_INFO,parameters, new ProblemInfoMapper());
} catch (Exception e) {
LOGGER.error("Error into the addGroup "+e.getMessage());
e.printStackTrace();
throw new DaoException();
}
return listOfProblmes;

Note : i am Not getting any Exception or error But i am unable to get all customer details ,here i am getting only one customer deatils


Thanks
Anji
8 years ago
Thanks for very much Karthik Shiraly , you saved my time lot
HI Team ,

Please help here . i am unable to display the Task Information Please find the below classes & confg files and Db tables information.


SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Hibernate: select this_.TASK_ID as TASK1_4_0_, this_.TASKCOMMENTS as TASKCOMM2_4_0_, this_.TASKDATE as TASKDATE4_0_, this_.IMPCOMMENTS as IMPCOMME4_4_0_, this_.NAME as NAME4_0_, this_.PRIPORTY as PRIPORTY4_0_, this_.TASKSTATUS) as TASKSTATUS7_4_0_, this_.TASKTIMESTAMP as TASKTIME8_4_0_, this_.TASKTYPE as TASKTYPE4_0_, this_.TASKUPDATETIME as TASKUPD10_4_0_, this_.TUPDATEDBY as TUPDATEDBY4_0_ from TASKINFO this_
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2536)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at com.iwinner.rms.dao.impl.TaskInfoDaoImpl.viewAllTasksInfo(TaskInfoDaoImpl.java:161)
at com.iwinner.rms.dao.impl.TaskInfoDaoImpl.main(TaskInfoDaoImpl.java:173)
Caused by: java.sql.SQLException: ORA-00923: FROM keyword not found where expected

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1038)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1133)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
at org.hibernate.loader.Loader.doQuery(Loader.java:802)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)
... 7 more

My Entity Class ::

package com.iwinner.rms.model;
import java.sql.Timestamp;


import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "TaskInfo")
public class TaskInfo implements java.io.Serializable {

private static final long serialVersionUID = 1L;
@Id
@Column(name = "TASK_ID")
private Integer taskId;

@Column(name = "TASK_NAME")
private String taskName;

@Column(name = "TASKDATE")
private Date taskDate;

@Column(name = "TASKCOMMENTS")
private String comments;

@Column(name = "TASKUPDATETIME")
private Timestamp taskUpdateTime;

@Column(name = "TUPDATEDBY")
private String taskUpdatedBy;

@Column(name = "TASK_PRIPORTY")
private String taskPriporty;

@Column(name = "TASKTIMESTAMP")
private Timestamp taskTime;

@Column(name = "IMPCOMMENTS")
private String taskImpComments;

@Column(name = "TASKTYPE")
private String taskType;

@Column(name = "TASKSTATUS)")
private String taskStatus;


sexXXXX & getXXXX

}
DB Table Name :
( TaskInfo) below columns

TASK_ID
TASK_NAME
TASKDATE
TASKCOMMENTS
TASKUPDATETIME
TUPDATEDBY
TASK_PRIPORTY
TASKTIMESTAMP
IMPCOMMENTS
TASKTYPE
TASKSTATUS

hibernate-cfg.xml

NOTE : i tried below dialect classes
i) org.hibernate.dialect.Oracle10gDialect ii) org.hibernate.dialect.OracleDialect
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>
<!-- Production DB Info -->
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:xe</property>
<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="connection.username">rms_pro</property>
<property name="connection.password">rms_pro</property>
<!-- <property name="validationQuery">select 1 from dual</property>
--> <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>
<!-- <mapping resource="/com/st/mapping/Floor.hbm.xml"/> -->
<mapping class="com.iwinner.rms.model.Audit"></mapping>
<mapping class="com.iwinner.rms.model.Users"></mapping>
<mapping class="com.iwinner.rms.model.ItemInfo"></mapping>
<mapping class="com.iwinner.rms.model.UserRole"></mapping>
<mapping class="com.iwinner.rms.model.TaskInfo"></mapping>
<mapping class="com.iwinner.rms.model.URLSave"></mapping>
</session-factory>

</hibernate-configuration>

TaskDaoImpl class
public class TaskDaoImpl implements TaskDaoIF{

public List<TaskInfo> viewAllTasksInfo() throws DaoException {
LOGGER.info("***** start of viewAllTasksInfo() is processing ***** ") ;
List<TaskInfo> viewAllTasks=new ArrayList<TaskInfo>();
try{
/*Session session = HibernateUtils.getSession();
System.out.println("002");
Criteria criteria = session.createCriteria(TaskInfo.class);
viewAllTasks = criteria.list();
*/
Session session = HibernateUtils.getSession();
session.beginTransaction().begin();
Query query=session.createQuery(RMSConstants.SELECT_TASK_INFO);
viewAllTasks=query.list();
}catch(Exception e){
e.printStackTrace();
LOGGER.error("##### Error Inside viewAllTasksInfo() is processing ##### "+e.getMessage()) ;
}
LOGGER.info("***** end of viewAllTasksInfo() is processing ***** ") ;
return viewAllTasks;
}

public static void main(String[] args) throws Exception {
List<TaskInfo> viewAll=new ArrayList<TaskInfo>();
TaskInfoDaoImpl tD=new TaskInfoDaoImpl();
viewAll=tD.viewAllTasksInfo();

}

HI All,

Please find below my JSON object ,how can we split

[
{"alpha2Code":"AF",
"alpha3Code":"AFG",
"altSpellings":"AF, Afganistan",
"area":652230.0,
"callingcode":"93",
"capital":"Kabul",
"currency":"AFN",
"gini":27.8,
"isoNumericCode":"4",
"languages":["ps","uz","tk"],
"latlng":[33.0,65.0],
"name":"Afghanistan",
"nationality":"Afghan",
"population":25500100,
"region":"Asia",
"relevance":"0",
"subregion":"Southern Asia",
"timezones":["UTC+04:30"],
"topLevelDomain":".af",
"translations":{"de":"Afghanistan","en":"Afghanistan","es":"Afganistán","fr":"Afganistán"}
}}]

I need it should be split & Write Java code by JSONArray and JSONObject

Thanks
AnjaiahSpr
9 years ago
Thanks for reply , i got solutions , we need to add httpcore-nio-4.3.jar file because my previous adding jar(httpcore-nio-4.1-beta2.jar) getting problem.

Now am able to connect with marshup api endpoints


Thanks
AnjaiahSpr
9 years ago
HI All,

I am facing below problem while i am connecting with any services through(MashUp API)

I am using below Jars
i)commons-logging-1.1.3.jar
ii)httpasyncclient-4.0-beta4.jar
iii)httpclient-4.3.6.jar
iv)httpcore-4.3.3.jar
v)httpcore-nio-4.1-beta2.jar
vi)httpmime-4.3.6.jar
vii)unirest-java-1.3.27.jar

Code:
public static void main(String[] args) throws UnirestException {
HttpResponse<InputStream> response = Unirest.post("https://ofc.p.mashape.com/directConvert/")
.header("X-Mashape-Key", "Y3MxEWkOX3mshcvQ85SZCoIqucVMp1qRpjbjsn0TYnnY8c1fIR")
.field("file", new File("<file goes here>"))
.field("format", "woff")
.field("output", "tar.gz")
.asBinary();
System.out.println(response.getStatus());

/*HttpAsyncClient httpclient = new DefaultHttpAsyncClient();
httpclient.start();
HttpPost post = new HttpPost("https://ofc.p.mashape.com/directConvert/");//+postPairs.get(0).getValue());
//HttpPost post = new HttpPost("http://www.google.com");

Future<HttpResponse> future = httpclient.execute(post, null);*/
}
Facing Problem ::
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor: method <init>()V not found
at com.mashape.unirest.http.options.Options.refresh(Options.java:68)
at com.mashape.unirest.http.options.Options.<clinit>(Options.java:36)
at com.mashape.unirest.http.HttpClientHelper.prepareRequest(HttpClientHelper.java:153)
at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:133)
at com.mashape.unirest.request.BaseRequest.asBinary(BaseRequest.java:80)
at com.iwinner.mashap.consumer.api.MashMain.main(MashMain.java:19)
9 years ago
HI All

In My DB i have below values
Table Name : Users
ID Name
1 allen
2 mark
3 collin

Here i am select all values




In My Service class




// Here My Test class/

Here I am getting 3 times
3 collin
3 collin
3 collin


Please help me how to get All values from Table (User)
All Values Like Below
1 Allen
2 Mark
3 Collin

9 years ago