0

i am trying to insert hindi text but when i tried then in oracle database value inserted like this &2309;&2350;&2352;&2368;का"but i want to insert like this अमरीका..I need to save same as Hindi Format in DB..The following is the snippet plz help me out..

    controller page

    package com.nt.controller;

    import javax.annotation.Resource;

    import org.springframework.stereotype.Controller;
    import org.springframework.ui.ModelMap;
    import org.springframework.web.bind.annotation.ModelAttribute;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;

    import com.nt.bo.Student;
    import com.nt.service.StudentService;

    @Controller
    public class StudentController {
        @Resource
        private StudentService service;

        @RequestMapping(value="/student.htm",method=RequestMethod.GET)
        public void save(ModelMap map){
            Student student=new Student();
            map.put("student", student);
            map.addAttribute("stud");
        }
        @RequestMapping(value="/student.htm",method=RequestMethod.POST)
        public String saveSt(@ModelAttribute Student student) {
            service.addStudent(student);
            return "success";
        }
    }

o/p:
in oracle database==================== &2309;&2350;&2352;&2368;का
Stephen Docy
  • 4,738
  • 7
  • 18
  • 31

2 Answers2

0

I hope this will help stackoverflow link

Also try setting text-encoding in the database to UTF-8

  • If you cannot change the text-encoding in the database (which is often the case), you can maybe use nvarchar2 columns (should be UTF16). For Hibernate mapping nvarchar2, see @Nationalized. – Kirinya Apr 20 '18 at 15:08
0

We can use N before parameter. Ex: Insert into tablename(column) values(N'@columnValue' or N"value") and field datatype should be nvarchar2.