exceutesql.java.svn-base

来自「文件上传用例,纯sql分页源码,有用的着地方请下载 试用」· SVN-BASE 代码 · 共 42 行

SVN-BASE
42
字号
package temp;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

import org.derrick.jdbc.ConnectionFactory;
/**
 * 
 * @author 刘冬宝Oct 26, 2006
   版权申明:所有人员均可自由修改源码并再发布,但必须保留此相关信息
 *
 */
public class ExceuteSql {

	/**
	 * @param args
	 * @throws SQLException
	 */
	public static void main(String[] args) {
		ConnectionFactory factory = ConnectionFactory.getInstance();
		factory.setDbConfigFile("sybasedb.config");//
		factory.init();
		Connection conn = factory.getConnection();
		Statement st;
		try {
			st = conn.createStatement();

			String sql = "select * from ( select ID from OA_JSXXJL order by ID )"
					+ "  t  order by t.ID asc ";
			System.out.println(sql);
			st.execute(sql);
		} catch (SQLException e) {
				e.printStackTrace();
		} finally {
			ConnectionFactory.closeConnection(conn);
		}

	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?