我將MySQL換成了Oracle該怎樣實(shí)現(xiàn)
@Test
public void testWriterBlob() throws Exception{
Students s=new Students(1,"張三豐","男",new Date(),"武當(dāng)山");
//先獲得照片文件
File f=new File("d:"+File.separator+"flower.jpg");
//獲得照片文件的輸入流
InputStream input=new FileInputStream(f);
//創(chuàng)建有個(gè)blob對(duì)象
Blob image=Hibernate.getLobCreator(session).createBlob(input, input.available());
//設(shè)置照片屬性
s.setPicture(image);
session.save(s);
}
2017-09-27
?<property name="connection.url">jdbc:Oracle://127.0.0.1:3306/HiberTest</property>
??? <property name="connection.driver_class">com.Oracle.jdbc.Driver</property>
你試試行不行
2017-02-22
怎樣改!!!
2017-02-21
不是在這里改,換成Oracle時(shí)需要換卡驅(qū)動(dòng),這需要在配置文件中更改。