Java Hyd Team
746 subscribers
986 photos
39 videos
670 files
690 links
https://teamhydteam.my.canva.site/

Can visit us on our website 😊
Still working on it 😊
Download Telegram
package com.aman.Maven1;
import org.springframework.jdbc.core.JdbcTemplate;
public class UserBean {
private JdbcTemplate jt;
public UserBean() {
super();
}
public void setJt(JdbcTemplate jt) {
this.jt = jt;
}
public void create() {
jt.execute("create table userdetails1(userid number(20),name varchar2(30),mailid varchar2(30))");
System.out.println("one table created..");
}
public void insert() {
int i=jt.update("insert into userdetails1 values (102,'suraj','suraj@gamil.com')");
System.out.println(i+"one row inserted");
}
public void update() {
int i=jt.update("update userdetails1 set name='prathmesh' where userid=101");
System.out.println(i +"update sucesss");
}
public void delete() {
int i=jt.update("delete userdetails1 where userid=101");
System.out.println(i +"deleted sucesss");
}
}
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<bean id="id1" class="org.springframework.jdbc.datasource.DriverManagerDataSource">

<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@localhost:1521:xe" />
<property name="username" value="Amanrash" />
<property name="password" value="Amanrash" />
</bean>
<bean id="id2" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="id1"/>
</bean>
<bean id="id3" class="com.aman.Maven1.UserBean">
<property name="jt" ref="id2"/>
</bean>
</beans>
👍1
package com.aman.Maven1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class TestClass {

public static void main(String[] args) {
ApplicationContext c=new ClassPathXmlApplicationContext("spconfig.xml");
UserBean a=(UserBean)c.getBean("id3");
a.create();
a.insert();
a.update();
a.delete();
}


}
Complete strings and string buffer reader and string builder
Go through the topics
Java Hyd Team
Photo from Sambasivarao Pendela
Don't miss this exclusive free session 😊😊 great opportunity