XML Databases and Tools 2: read from blob : XML Database : XML : Java examples (example source code) Organized by topic

Java
C++
PHP


Java  »  XML   » [  XML Database  ]  Screenshots 
 



XML Databases and Tools 2: read from blob


import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.Statement;

public class MainClass {

  public static void main(String[] argsthrows Exception{
      Class.forName("COM.cloudscape.core.JDBCDriver").newInstance();

      Connection conn = DriverManager.getConnection("jdbc:cloudscape:GAMETRADER");

      conn.setAutoCommit(false);

      Statement s = conn.createStatement();
      s.executeUpdate("CREATE TABLE MANUALS(GAMEID INT, MANUAL LONG VARCHAR)");
      conn.commit();

      File file = new File("manuals.xml");
      InputStream is = new FileInputStream(file);

      PreparedStatement ps = conn.prepareStatement("INSERT INTO MANUALS VALUES(?,?)");

      ps.setInt(11285757);

      ps.setAsciiStream(2, is, (intfile.length());

      ps.execute();
      conn.commit();
  }
}
           
       
Related examples in the same category
1.  XML Databases and Tools 3
2.   XML Databases and Tools 1: read from clob
3.  XML Databases DOM
























Home| Contact Us
Copyright 2003 - 07 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.