用Java 设置的定位打印作业
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.OrientationRequested;
public class Main {
public static void main(String[] argv) throws Exception {
// Set up the attribute set
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(OrientationRequested.PORTRAIT);
// aset.add(OrientationRequested.LANDSCAPE);
}
}
相关文档:
代码如下:
1 String command = " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
2 try {
3 Process process& ......
import java.awt.*;
import javax.swing.*;
import java.util.Date;
import java.awt.*;
class Time extends JFrame implements Runnable{//实现接口
Thread clockThread;
JLabel jLabel=new JLabel();
public Time()
{
Container con=this.getContentPane() ......
1.List转换成为数组。(这里的List是实体是ArrayList)
调用ArrayList的toArray方法。
例:String[] arr = (String[])list.toArray(new String[size]);
2.数组转换成为List。
调用Arrays的asList方法。
例:List stooges = Arrays.asList("Larry", "Moe", "Curly"); ......
1.计算某一月份的最大天数
Calendar time=Calendar.getInstance();
time.clear();
time.set(Calendar.YEAR,year);
time.set(Calendar.MONTH,i-1);//注意,Calendar对象默认一月为0
int day=time.getActualMaximum(Calendar.DAY_OF_MONTH);//本月份的天数 ......
转帖处:http://dong-java.javaeye.com/blog/375150
1。推荐使用Oralce比较新的10.2.0.3 JDBC Drivers。这个版本对比9.2的最大的好处是DriverManager.setLoginTimeout函数是起作用的。设置了这个参数,在恶劣的网络环境中就不会有连接数据库的函数长时间不返回的情况。
2。JDBC Developer!ˉs Guide and Refer ......