hi
i de developped some code in which i have to receive data from a server over
sockets then send it into an oracle data base i need some help ,i'm new in
apache camel someone give me his opinion about this:
public class Action {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
CamelContext cnt = new DefaultCamelContext();
ConnectionFactory connectionFactory =new
ActiveMQConnectionFactory("vm://localhost");
cnt.addComponent("jms",JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
cnt.addRoutes(new MyRouteBuilder());
cnt.start();
Thread.sleep(1000);
cnt.stop();
}
/********route builder***********/
public class MyRouteBuilder extends RouteBuilder{
/**
* @param args
*/
@Override
public void configure() throws Exception {
from("mina:tcp://--adress--?textline=true")
.to("jms:queue:incomingorders")
.to("bean:orderToSql")
.to("jdbc:oracle--wboard--");
}
}
/************ordertoOrale**********/
public class orderToOracle {
public String toSql(@XPath("order/@name") String name,
@XPath("order/@amount") int amount,
@XPath("order/@customer") String customer) {
StringBuilder sb = new StringBuilder();
sb.append("insert into incoming_orders ");
sb.append("(part_name, quantity, customer) values (");
sb.append("'").append(name).append("', ");
sb.append("'").append(amount).append("', ");
sb.append("'").append(customer).append("') ");
return sb.toString();
}
}
--
View this message in context:
http://camel.465427.n5.nabble.com/from-server-to-oracle-tp5729049.html
Sent from the Camel - Users mailing list archive at Nabble.com.