本文整理汇总了Java中org.hsqldb.lib.java.JavaSystem类的典型用法代码示例。如果您正苦于以下问题:Java JavaSystem类的具体用法?Java JavaSystem怎么用?Java JavaSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JavaSystem类属于org.hsqldb.lib.java包,在下文中一共展示了JavaSystem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: length
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public long length() throws IOException {
try {
return file.length();
} catch (IOException e) {
logger.logWarningEvent(JVM_ERROR, e);
throw e;
} catch (Throwable t) {
logger.logWarningEvent(JVM_ERROR, t);
IOException io = JavaSystem.toIOException(t);
throw io;
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:17,代码来源:RAFileNIO.java
示例2: read
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public int read() throws IOException {
checkClosed();
if (currentPosition >= availableLength) {
return -1;
}
if (buffer == null
|| currentPosition >= bufferOffset + buffer.length) {
try {
checkClosed();
readIntoBuffer();
} catch (Exception e) {
throw JavaSystem.toIOException(e);
}
}
int val = buffer[(int) (currentPosition - bufferOffset)];
currentPosition++;
return val;
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:25,代码来源:ClobInputStream.java
示例3: read
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public int read() throws IOException {
checkClosed();
if (currentPosition >= availableLength) {
return -1;
}
if (buffer == null
|| currentPosition >= bufferOffset + buffer.length) {
try {
checkClosed();
readIntoBuffer();
} catch (Exception e) {
throw JavaSystem.toIOException(e);
}
}
int val = buffer[(int) (currentPosition - bufferOffset)] & 0xff;
currentPosition++;
return val;
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:25,代码来源:BlobInputStream.java
示例4: save
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
/**
* Saves the properties using JDK2 method if present, otherwise JDK1.
*/
public void save(String fileString) throws Exception {
// [email protected]
fa.createParentDirs(fileString);
OutputStream fos = fa.openOutputStreamElement(fileString);
FileAccess.FileSync outDescriptor = fa.getFileSync(fos);
JavaSystem.saveProperties(
stringProps,
HsqlDatabaseProperties.PRODUCT_NAME + " "
+ HsqlDatabaseProperties.THIS_FULL_VERSION, fos);
fos.flush();
outDescriptor.sync();
fos.close();
return;
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:22,代码来源:HsqlProperties.java
示例5: close
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public void close() throws IOException {
try {
database.logger.logDetailEvent("NIO file close, size: "
+ fileLength);
buffer = null;
channel = null;
for (int i = 0; i < buffers.length; i++) {
unmap(buffers[i]);
buffers[i] = null;
}
file.close();
// System.gc();
} catch (Throwable t) {
database.logger.logWarningEvent("NIO buffer close error", t);
IOException io = JavaSystem.toIOException(t);
throw io;
}
}
开发者ID:Julien35,项目名称:dev-courses,代码行数:27,代码来源:RAFileNIO.java
示例6: setProperties
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
/**
* Sets server properties using the specified properties object
*
* @param p The object containing properties to set
*/
public void setProperties(HsqlProperties p) {
checkRunning(false);
if (p != null) {
serverProperties.addProperties(p);
ServerConfiguration.translateAddressProperty(serverProperties);
}
maxConnections = serverProperties.getIntegerProperty(
ServerConstants.SC_KEY_MAX_CONNECTIONS, 16);
JavaSystem.setLogToSystem(isTrace());
isSilent =
serverProperties.isPropertyTrue(ServerConstants.SC_KEY_SILENT);
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:23,代码来源:Server.java
示例7: setProperties
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
/**
* Sets server properties using the specified properties object
*
* @param p The object containing properties to set
*/
public void setProperties(HsqlProperties p) {
checkRunning(false);
if (p != null) {
serverProperties.addProperties(p);
ServerConfiguration.translateAddressProperty(serverProperties);
}
maxConnections = serverProperties.getIntegerProperty(
ServerConstants.SC_KEY_MAX_CONNECTIONS, 16);
JavaSystem.setLogToSystem(isTrace());
isSilent =
serverProperties.isPropertyTrue(ServerConstants.SC_KEY_SILENT);
isRemoteOpen = serverProperties.isPropertyTrue(
ServerConstants.SC_KEY_REMOTE_OPEN_DB);
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:Server.java
示例8: read
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public void read(byte[] b, int offset, int length) throws IOException {
try {
while (true) {
checkBuffer();
long transferLength = bufferPosition + bufferLength
- currentPosition;
if (transferLength > length) {
transferLength = length;
}
buffer.get(b, offset, (int) transferLength);
positionBufferMove((int) transferLength);
length -= transferLength;
offset += transferLength;
if (length == 0) {
break;
}
}
} catch (Throwable t) {
logger.logWarningEvent(JVM_ERROR, t);
IOException io = JavaSystem.toIOException(t);
throw io;
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:32,代码来源:RAFileNIO.java
示例9: write
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public void write(byte[] b, int offset, int length) throws IOException {
long transferLength;
try {
buffersModified = true;
while (true) {
checkBuffer();
transferLength = bufferPosition + bufferLength
- currentPosition;
if (transferLength > length) {
transferLength = length;
}
buffer.put(b, offset, (int) transferLength);
positionBufferMove((int) transferLength);
length -= transferLength;
offset += transferLength;
if (length == 0) {
break;
}
}
} catch (Throwable t) {
logger.logWarningEvent(JVM_ERROR, t);
IOException io = JavaSystem.toIOException(t);
throw io;
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:36,代码来源:RAFileNIO.java
示例10: execute
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
/**
* Executes a generic CompiledStatement. Execution includes first building
* any subquery result dependencies and clearing them after the main result
* is built.
*
* @return the result of executing the statement
* @param cs any valid CompiledStatement
*/
Result execute(CompiledStatement cs, Object[] paramValues) {
Result result = null;
JavaSystem.gc();
for (int i = 0; i < cs.parameters.length; i++) {
cs.parameters[i].bind(paramValues[i]);
}
try {
cs.materializeSubQueries(session);
result = executeImpl(cs);
} catch (Throwable t) {
result = new Result(t, cs.sql);
}
// clear redundant data
cs.dematerializeSubQueries(session);
if (result == null) {
result = emptyZeroResult;
}
return result;
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:36,代码来源:CompiledStatementExecutor.java
示例11: writeLong
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public void writeLong(long i) throws IOException {
try {
buffersModified = true;
buffer.putLong(i);
positionBufferMove(8);
} catch (Throwable t) {
logger.logWarningEvent(JVM_ERROR, t);
IOException io = JavaSystem.toIOException(t);
throw io;
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:16,代码来源:RAFileNIO.java
示例12: convertToTypeLimits
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
/** @todo - review usage to see if range enforcement / java type conversion is necessary */
public Object convertToTypeLimits(SessionInterface session, Object a) {
if (a == null) {
return null;
}
switch (typeCode) {
case Types.TINYINT :
case Types.SQL_SMALLINT :
case Types.SQL_INTEGER :
case Types.SQL_BIGINT :
return a;
case Types.SQL_REAL :
case Types.SQL_FLOAT :
case Types.SQL_DOUBLE :
return a;
case Types.SQL_NUMERIC :
case Types.SQL_DECIMAL : {
BigDecimal dec = (BigDecimal) a;
if (scale != dec.scale()) {
dec = dec.setScale(scale, BigDecimal.ROUND_HALF_DOWN);
}
int p = JavaSystem.precision(dec);
if (p > precision) {
throw Error.error(ErrorCode.X_22003);
}
return dec;
}
default :
throw Error.runtimeError(ErrorCode.U_S0500, "NumberType");
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:41,代码来源:NumberType.java
示例13: convertToDefaultType
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
/**
* Relaxes SQL parameter type enforcement, allowing long strings.
*/
public Object convertToDefaultType(SessionInterface session, Object a) {
if (a == null) {
return a;
}
String s;
if (a instanceof Boolean) {
s = a.toString();
} else if (a instanceof BigDecimal) {
s = JavaSystem.toString((BigDecimal) a);
} else if (a instanceof Number) {
s = a.toString(); // use shortcut
} else if (a instanceof String) {
s = (String) a;
} else if (a instanceof java.sql.Date) {
s = a.toString();
} else if (a instanceof java.sql.Time) {
s = a.toString();
} else if (a instanceof java.sql.Timestamp) {
s = a.toString();
} else if (a instanceof java.util.Date) {
s = HsqlDateTime.getTimestampString(
((java.util.Date) a).getTime());
} else {
throw Error.error(ErrorCode.X_42561);
}
return s;
// return convertToType(session, a, Type.SQL_VARCHAR);
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:37,代码来源:CharacterType.java
示例14: init
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
/**
* Initializes this server, setting the accepted connection protocol.
*
* @param protocol typically either SC_PROTOCOL_HTTP or SC_PROTOCOL_HSQL
*/
protected void init(int protocol) {
// PRE: This method is only called from the constructor
serverState = ServerConstants.SERVER_STATE_SHUTDOWN;
serverConnSet = new HashSet();
serverId = toString();
serverId = serverId.substring(serverId.lastIndexOf('.') + 1);
serverProtocol = protocol;
serverProperties = ServerConfiguration.newDefaultProperties(protocol);
logWriter = new PrintWriter(System.out);
errWriter = new PrintWriter(System.err);
JavaSystem.setLogToSystem(isTrace());
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:20,代码来源:Server.java
示例15: ScriptReaderDecode
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public ScriptReaderDecode(Database db, String fileName, Crypto crypto,
boolean forLog) throws IOException {
super(db, fileName);
this.crypto = crypto;
try {
inputStream =
db.logger.getFileAccess().openInputStreamElement(fileName);
bufferedStream = new BufferedInputStream(inputStream);
rowIn = new RowInputTextLog();
if (forLog) {
dataInput = new DataInputStream(bufferedStream);
} else {
cryptoStream = crypto.getInputStream(bufferedStream);
gzipStream = new GZIPInputStream(cryptoStream);
dataStreamIn = new LineReader(gzipStream,
ScriptWriterText.ISO_8859_1);
}
} catch (Throwable t) {
close();
throw JavaSystem.toIOException(t);
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:28,代码来源:ScriptReaderDecode.java
示例16: openInputStreamElement
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public InputStream openInputStreamElement(String streamName)
throws IOException {
try {
return new FileInputStream(new File(streamName));
} catch (Throwable e) {
throw JavaSystem.toIOException(e);
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:10,代码来源:FileUtil.java
示例17: writeDecimal
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
protected void writeDecimal(BigDecimal o, Type type) {
int scale = o.scale();
BigInteger bigint = JavaSystem.unscaledValue(o);
byte[] bytearr = bigint.toByteArray();
writeByteArray(bytearr);
writeInt(scale);
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:10,代码来源:RowOutputBinary.java
示例18: ceiling
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public Object ceiling(Object a) {
if (a == null) {
return null;
}
switch (typeCode) {
case Types.SQL_REAL :
case Types.SQL_FLOAT :
case Types.SQL_DOUBLE : {
double ad = Math.ceil(((Double) a).doubleValue());
if (Double.isInfinite(ad)) {
throw Error.error(ErrorCode.X_22003);
}
return ValuePool.getDouble(Double.doubleToLongBits(ad));
}
case Types.SQL_NUMERIC :
case Types.SQL_DECIMAL : {
BigDecimal value = ((BigDecimal) a).setScale(0,
BigDecimal.ROUND_CEILING);
if (JavaSystem.precision(value) > precision) {
throw Error.error(ErrorCode.X_22003);
}
}
// fall through
default :
return a;
}
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:35,代码来源:NumberType.java
示例19: compareIgnoreCase
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
public int compareIgnoreCase(String a, String b) {
int i;
if (collator == null) {
i = JavaSystem.CompareIngnoreCase(a, b);
} else {
i = collator.compare(toUpperCase(a), toUpperCase(b));
}
return (i == 0) ? 0
: (i < 0 ? -1
: 1);
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:15,代码来源:Collation.java
示例20: compareIgnoreCase
import org.hsqldb.lib.java.JavaSystem; //导入依赖的package包/类
int compareIgnoreCase(String a, String b) {
int i;
if (collator == null) {
i = JavaSystem.CompareIngnoreCase(a, b);
} else {
i = collator.compare(toUpperCase(a), toUpperCase(b));
}
return (i == 0) ? 0
: (i < 0 ? -1
: 1);
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:Collation.java
注:本文中的org.hsqldb.lib.java.JavaSystem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论