NEED TO LEARN JAVA? – 5 FREE JAVA VIDEO COURSES – CLICK HERE – https://goo.gl/7i95F8 — View more videos on my “Java JDBC Tutorial” Playlist: …
Original source
NEED TO LEARN JAVA? – 5 FREE JAVA VIDEO COURSES – CLICK HERE – https://goo.gl/7i95F8 — View more videos on my “Java JDBC Tutorial” Playlist: …
Original source
10 responses to “Java JDBC Tutorial – Part 11: CLOB – Reading and Writing CLOB with MySQL”
For people, who will not download the source code. When you try to read CLOB, keep in mind that you have to close the writer:
writer.close();
hi. thank you for your videos 🙂
Could you tell me how to get rid of this kind of excepton
java.sql.SQLException: Incorrect string value: 'xEFxBBxBFFUC.. ?
Hello chad,, file completed successfuly but the text file is completely blank….
hello luv2code , I am getting following exception:Exception in thread "main" java.io.FileNotFoundException: New Text Document.txt (The system cannot find the file specified)Could you please tell me where we suppose to store file in local drive?
Hello ,
I wrote this simple code to read from blob file in the database and write to a local file .
it creates a local file but it doesn't write on it , i don't know what i miss.
__________________________________
import java.io.*;
import java.sql.*;
public class ClobsWriteFileToDB {
public static void main(String[] args) {
String url = "jdbc:mysql://localhost:3306/testschema";
String user = "root";
String pass = "isoft123";
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection myConn = DriverManager.getConnection(url, user, pass);
String sql = "select cv from test where id=2";
Statement myStmt = myConn.createStatement();
ResultSet myRs = myStmt.executeQuery(sql);
File theFile = new File("outPutSamlple.txt");
FileWriter output = new FileWriter(theFile);
if (myRs.next()) {
Reader input = myRs.getCharacterStream("cv");
int theChar;
while ((theChar = input.read()) > 0) {
output.write(theChar);
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
can we store videos in database? how?
Thanks, perfect videos! With your help i've learned JDBC ^) Thinking what to study then, jsp or hibernate…What do you think?
so basically the main difference between BLOB and CLOB is BinaryStream and CharacterStream ? (in javaCode)
i want to store data from <textarea> tag of html to oracle database as a CLOB object.will u please help. my email id is diahard4.0@gmail.com
thanks
Super!))