当前位置: 首页>>代码示例>>Java>>正文


Java RCData类代码示例

本文整理汇总了Java中org.hsqldb.lib.RCData的典型用法代码示例。如果您正苦于以下问题:Java RCData类的具体用法?Java RCData怎么用?Java RCData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RCData类属于org.hsqldb.lib包,在下文中一共展示了RCData类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: connect

import org.hsqldb.lib.RCData; //导入依赖的package包/类
public void connect() throws SQLException {
    if (conn != null) {
        throw new IllegalStateException("Thread '" + getName()
                + "' has already been connected");
    }
    try {
        conn = rcdata.getConnection();
    } catch (Exception e) {
        throw new RuntimeException(
                "Failed to connect to get JDBC connection for '"
                + getName() + "'", e);
    }
    conn.setAutoCommit(false);
    System.out.println("ScriptRun '" + getName() + "' connected with "
            + RCData.tiToString(conn.getTransactionIsolation()) + '.');
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:17,代码来源:TestScriptRunner.java

示例2: getBanner

import org.hsqldb.lib.RCData; //导入依赖的package包/类
/**
 * Returns a String report for the specified JDBC Connection.
 *
 * For databases with poor JDBC support, you won't get much detail.
 */
public static String getBanner(Connection c) {
    try {
        DatabaseMetaData md = c.getMetaData();
        return (md == null)
                ? null
                : SqltoolRB.jdbc_established.getString(
                        md.getDatabaseProductName(),
                        md.getDatabaseProductVersion(),
                        md.getUserName(),
                                (c.isReadOnly() ? "R/O " : "R/W ")
                                + RCData.tiToString(
                                c.getTransactionIsolation()));
    } catch (SQLException se) {
        return null;
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:22,代码来源:SqlFile.java

示例3: promptForPassword

import org.hsqldb.lib.RCData; //导入依赖的package包/类
/**
 * Prompt the user for a password.
 *
 * @param username The user the password is for
 * @return The password the user entered
 */
private static String promptForPassword(String username)
throws PrivateException {

    BufferedReader console;
    String         password;

    password = null;

    try {
        console = new BufferedReader(new InputStreamReader(System.in));

        // Prompt for password
        System.out.print(SqltoolRB.passwordFor_prompt.getString(
                RCData.expandSysPropVars(username)));

        // Read the password from the command line
        password = console.readLine();

        if (password == null) {
            password = "";
        } else {
            password = password.trim();
        }
    } catch (IOException e) {
        throw new PrivateException(e.getMessage());
    } finally {
        console = null;  // Encourage GC of buffers
    }

    return password;
}
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:38,代码来源:SqlTool.java

示例4: ScriptRun

import org.hsqldb.lib.RCData; //导入依赖的package包/类
public ScriptRun(String name, Reader reader, RCData rcdata) {
    super(name);
    this.reader = reader;
    this.rcdata = rcdata;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:6,代码来源:TestScriptRunner.java

示例5: TestScriptRunner

import org.hsqldb.lib.RCData; //导入依赖的package包/类
public TestScriptRunner(String rcFileString, Map scriptFileMap)
        throws IOException {
    TestUtil.setAbortOnErr(true);
    Map rcdataMap = new HashMap();
    File rcFile = new File(rcFileString);
    if (!rcFile.isFile())
        throw new IllegalArgumentException(
                "RC file '" + rcFileString + "' not a file");

    String scriptPath, urlid;
    Iterator it;
    File file;
    Reader reader = null;

    it = scriptFileMap.values().iterator();
    while (it.hasNext()) {
        urlid = (String) it.next();
        if (rcdataMap.containsKey(urlid)) continue;
        try {
            rcdataMap.put(urlid, new RCData(rcFile, urlid));
        } catch (Exception e) {
            throw new RuntimeException(
                    "Failed to instantiate RCData with file '"
                    + rcFile + "' for urlid '" + urlid + "'", e);
        }
    }

    it = scriptFileMap.keySet().iterator();
    while (it.hasNext()) {
        scriptPath = (String) it.next();
        urlid = (String) scriptFileMap.get(scriptPath);

        if (scriptPath.equals("-")) {
            reader = new InputStreamReader(System.in);
        } else {
            file = new File(scriptPath);
            if (!file.isFile()) throw new IOException("'" + file
                    + "' is not a file");
            if (!file.canRead()) throw new IOException("'" + file
                    + "' is not readable");
            reader = new FileReader(file);
        }
        scriptRuns.add(new ScriptRun(scriptPath,
                reader, (RCData) rcdataMap.get(urlid)));
    }
}
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:47,代码来源:TestScriptRunner.java

示例6: SqlFileEmbedder

import org.hsqldb.lib.RCData; //导入依赖的package包/类
/**
 * Instantiates SqlFileEmbedder object and connects to specified database.
 * <P/>
 * N.b., you do not need to use RCData to use SqlFile.
 * All SqlFile needs is a live Connection.
 * I'm using RCData because it is a convenient way for a non-contained
 * app (i.e. one that doesn't run in a 3rd party container) to get a
 * Connection.
 */
public SqlFileEmbedder(File rcFile, String urlid) throws Exception {
    conn = (new RCData(rcFile, urlid)).getConnection();
    conn.setAutoCommit(false);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:14,代码来源:SqlFileEmbedder.java


注:本文中的org.hsqldb.lib.RCData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。