JDBC中回滚事务是使用Connection接口的()方法
A. commit()
B. rollback()
C. close()
D. setAutoCommit()
以下代码实现了文件的拷贝。请给出缺失的代码,使程序能正确执行。public static void copyFile(String srcfilePathAndName, String targetfilePathAndName) {try {File sourceFile = new ____(1)_____;FileInputStream in = new FileInputStream(srcfilePathAndName);int len = (int)sourceFile.length();byte[] bt = new ____(2)___;in.read(bt); //读取bt.length个字节数据存放到bt字节数组中File copyFile = new File(targetfilePathAndName);FileOutputStream out = new FileOutputStream(copyFile);____(3)____; //将bt字节数组数据写入文件中out.close();in.close();} catch (IOException e) {e.printStackTrace();}}
以下代码实现了客户端与服务端的数据传输。请给出缺失的代码,使程序能正确执行。public class Ex8_2S {public static void main(String[] args) throws Exception{byte buf[]=new byte[1024];DatagramPacket dp=new DatagramPacket(buf,buf.length);DatagramSocket ds=new ____(1)____;System.out.println("Server started.");while(true){____(2)____; //阻塞式的接收System.out.println(new String(buf,0,dp.getLength())+",Server!");}}}public class Ex8_2C {public static void main(String[] args) throws Exception{byte[] buf=(new String("Hello")).getBytes();InetSocketAddress isa = new InetSocketAddress("127.0.0.1",5678);DatagramPacket dp= new DatagramPacket(____(3)____);DatagramSocket ds=new DatagramSocket(9999);____(4)____; //发送到指定的服务器端口ds.close();}}
对T形件,为提高材料的利用率,应采用________________。
A. 多排
B. 直对排
C. 斜对排
D. 斜排