Python支持多数据库
但我想要一个桌面应用程序的数据库,它可以包含在 python py2exe 的设置中
当应用程序包被移动时,它的数据库也想移动
例如它可能与文本文件,但我想要一个以表格格式存储数据的数据库。
建议想法,数据库相关性...
private static String encodeFileToBase64Binary(String fileName)
throws IOException {
File file = new File(fileName);
byte[] bytes = loadFile(file);
byte[] encoded = Base64.encodeBase64(bytes);
String encodedString = new String(encoded,StandardCharsets.US_ASCII);
return encodedString;
}
private static byte[] loadFile(File file) throws IOException {
InputStream is = new FileInputStream(file);
long length = file.length();
if (length > Integer.MAX_VALUE) {
// File is too large
}
byte[] bytes = new byte[(int)length];
int offset = 0;
int numRead = 0;
while (offset < bytes.length
&& (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) …Run Code Online (Sandbox Code Playgroud)