- 浏览: 38779 次
- 性别:
- 来自: 广州
文章分类
最新评论
package dbconnection;
import java.sql.*;
import java.util.*;
public class DbData {
public static void main(String [] args) throws ClassNotFoundException, SQLException
{
//連接數據庫的驅動
String driver = "oracle.jdbc.driver.OracleDriver";
//連接數據的具體信息,如IP地址接口,SID
String url="jdbc:oracle:thin:@172.24.22.1:1521:g2shjdb";
//String url="jdbc:oracle:thin:@//172.24.22.1:1521/TESTS10";
Object factno = null,brandno = null,bname = null,mark = null;
DbData dbget = new DbData();
Connection conn = dbget.getconnection(driver,url,"nbmis","nbmis");
//設置連接數據庫的sql,? 表示需傳入參數
PreparedStatement pst = conn.prepareStatement("select * from brandwei where fact_no =? and brand_no =?");
//設定第一個參數值
pst.setString(1, "0236");
//設定第二個參數值
pst.setString(2, "NB");
//真正執行查詢語句,并把結果放入ResultSet游標中
ResultSet reader = pst.executeQuery();
while(reader.next())
{
//String bname = (String) ResultSet.getString(1);
factno = reader.getObject(1);
brandno = reader.getObject(2);
bname = reader.getObject(3);
mark = reader.getObject(4);
System.out.print((String)factno + ' ' + (String)brandno + ' ' + (String)bname + ' ' + (String)mark);
}
//關閉游標
reader.close();
//System.out.println("----------------------------");
//delete 掉數據庫中的資料
PreparedStatement pst2 = conn.prepareStatement("delete from brandwei where fact_no =? and brand_no =?");
pst2.setString(1, "0236");
pst2.setString(2, "NB");
//返回刪除了多少行,如沒有刪除到則返回0
int delcount = pst2.executeUpdate();
System.out.println("delete count=" + delcount);
//update資料到數據庫中
PreparedStatement pst3 = conn.prepareStatement("update brandwei set mark_no='W' where fact_no =? and brand_no =?");
pst3.setString(1, "0236");
pst3.setString(2, "WR");
int updcount = pst3.executeUpdate();
System.out.println("update count=" + updcount);
//insert into 資料到數據庫中
PreparedStatement pst4 = conn.prepareStatement("insert into brandwei(fact_no, brand_no, brand_nm, mark_no) values('0236', ?, ?, ?)");
pst4.setString(1, "NB");
pst4.setString(2, "NEW BALANCE");
pst4.setString(3, "test");
int intcount = pst4.executeUpdate();
System.out.println("insert into count=" + intcount);
//設置連接數據庫的sql,? 表示需傳入參數
PreparedStatement pst8 = conn.prepareStatement("select * from brandwei where fact_no =?");
//設定第一個參數值
pst8.setString(1, "0236");
//真正執行查詢語句,并把結果放入ResultSet游標中
ResultSet reader8 = pst8.executeQuery();
while(reader8.next())
{
//String bname = (String) ResultSet.getString(1);
factno = reader8.getObject(1);
brandno = reader8.getObject(2);
bname = reader8.getObject(3);
mark = reader8.getObject(4);
//System.out.print((String)factno + ' ' + (String)brandno + ' ' + (String)bname + ' ' + (String)mark);
}
//關閉游標8
reader8.close();
HashMap<String,Object> hm = new HashMap<String,Object>();
/*向集合中添加指定的键值对*/
hm.put("11", "test map1!");
hm.put("22", "test map222222!");
//遍歷方法1
Iterator<String> iterator = hm.keySet().iterator();
while(iterator.hasNext()) {
System.out.println(hm.get(iterator.next()));
}
//遍歷方法2
Collection<Object> c = hm.values();
for(Iterator<Object> it=c.iterator();it.hasNext();){
System.out.println(it.next());
}
//遍歷方法3
Set<Map.Entry<String, Object>> set=hm.entrySet();
for(Iterator<Map.Entry<String, Object>> it=set.iterator();it.hasNext();){
Map.Entry<String, Object> mapEnter=it.next();
System.out.println("key="+mapEnter.getKey()+",value="+mapEnter.getValue());
}
//試驗多態性
List list = new ArrayList();
ArrayList arrayList = new ArrayList();
List a=new ArrayList();
//list.trimToSize(); //错误,没有该方法。ArrayList特有的方法
list.clear();
arrayList.trimToSize(); //ArrayList里有该方法。
ArrayList<Integer> s = new ArrayList<Integer>();
s.add(600);
s.add(100);
s.add(200);
//使用for-each
for(int lta:s)
{
System.out.println(lta);
}
/*此為023A數據庫factory_old檔資料移到0236數據庫factory_old檔中*/
int li_count;
int li_map = 1;
//設置連接數據庫的sql,? 表示需傳入參數
PreparedStatement apst = conn.prepareStatement("select * from factory_old where trans_code =?");
//設定第一個參數值
apst.setString(1, "N");
//真正執行查詢語句,并把結果放入ResultSet游標中
ResultSet readera = apst.executeQuery();
//ResultSetMetaData類保存了所有ResultSet类对象中关于字段等元数据信息,并提供许多方法来取得这些信息。
ResultSetMetaData rsmd = apst.getMetaData();
li_count = rsmd.getColumnCount();
System.out.println("factory_old的列數=" + li_count);
ArrayList<HashMap<String, Object>> dlist = new ArrayList<HashMap<String, Object>>();
while(readera.next())
{
HashMap<String, Object> dmap = new HashMap<String, Object>();
//把資料寫入map當中
for(li_map= 1; li_map <= li_count; li_map++)
{
dmap.put(String.valueOf(li_map),readera.getObject(li_map));
System.out.print(String.valueOf(li_map) + "=" + dmap.get(String.valueOf(li_map)) + " ");
}
dlist.add(dmap);
System.out.println("");
}
//關閉游標
readera.close();
//disconnection斷掉與數據庫的連接
dbget.disConnection(conn);
//連接第二個數據庫S10
String driver2 = "oracle.jdbc.driver.OracleDriver";
//連接數據的具體信息,如IP地址接口,SID
String url2="jdbc:oracle:thin:@172.24.22.1:1521:g2shjdb";
Connection conn2 = dbget.getconnection(driver2, url2, "s10mis", "tests10mis");
System.out.println("-------------遍歷ArrayList<HashMap<String, Object>> ------");
System.out.println("筆數:" + dlist.size());
//for-each方式处理方式
dbget.forEach(conn2, dlist, li_count);
//用iterator方式
long ll_st = System.currentTimeMillis();
Iterator<HashMap<String, Object>> itdl = dlist.iterator();
while(itdl.hasNext()) {
HashMap<String, Object> dlnMap = itdl.next();
PreparedStatement pstudb = conn2.prepareStatement("update factory_old set fact_nm =?,master_no =?,trans_code =?,stkdist_code =?,fact_f_nm =?" +
" where fact_no =?");
//insert into 資料到數據庫中
PreparedStatement pstdb = conn2.prepareStatement("insert into factory_old(fact_no, fact_nm,master_no,trans_code,stkdist_code,fact_f_nm) " +
"values(?, ?, ?, ?, ?, ?)");
//把值依順序從dlnMap中取出來
for(li_map= 2; li_map <= li_count; li_map++)
{
System.out.print(dlnMap.get(String.valueOf(li_map)));
pstdb.setString(li_map, (String)dlnMap.get(String.valueOf(li_map)));
pstudb.setString(li_map-1, (String)dlnMap.get(String.valueOf(li_map)));
}
pstdb.setString(1, (String) dlnMap.get("1"));
pstudb.setString(li_count, (String) dlnMap.get("1"));
int updbcount = pstudb.executeUpdate();
System.out.println("update factory_old=" + updbcount);
//先update,無則insert into
if(updbcount <= 0 )
{
int dbintcount = pstdb.executeUpdate();
System.out.println("insert into factory_old=" + dbintcount);
}
/*Iterator<String> itlMap = dlnMap.keySet().iterator();
while(itlMap.hasNext())
{
System.out.println(dlnMap.get(itlMap.next()));
}*/
pstudb.close();
pstdb.close();
System.out.println("----------------------------------------");
}
System.out.println("直接insert使用毫秒=" + (System.currentTimeMillis() - ll_st));
/*long ll_stad = System.currentTimeMillis();
//批量 insert into 資料到數據庫中
PreparedStatement pstad = conn2.prepareStatement("insert into factory_old(fact_no, fact_nm,master_no,trans_code,stkdist_code,fact_f_nm) " +
"values(?, ?, ?, ?, ?, ?)");
Iterator<HashMap<String, Object>> itdlab = dlist.iterator();
while(itdlab.hasNext()) {
HashMap<String, Object> dlnMap = itdlab.next();
//把值依順序從dlnMap中取出來
for(li_map= 1; li_map <= li_count; li_map++)
{
pstad.setString(li_map, (String)dlnMap.get(String.valueOf(li_map)));
}
//addBatch();执行后暂时记录此条插入
pstad.addBatch();
}
//执行后开始批量插入数据
pstad.executeBatch();
System.out.println("批處理使用毫秒=" + (System.currentTimeMillis() - ll_stad));*/
conn2.commit();
//disconnection斷掉與數據庫2的連接
dbget.disConnection(conn2);
}
public Connection getconnection(String driver, String url, String userid, String password) throws ClassNotFoundException, SQLException
{
/*格式一: Oracle JDBC Thin using a ServiceName jdbc:oracle:thin:@//<host>:<port>/<service_name>
* Example: jdbc:oracle:thin:@//192.168.2.1:1521/xifenfei
* 格式二: Oracle JDBC Thin using an SID jdbc:oracle:thin:@<host>:<port>:<SID>
* Example: jdbc:oracle:thin:192.168.2.1:1521:xff --注意这里的格式,@后面有//, 这是与使用SID的主要区别。
* 格式三:Oracle JDBC Thin using a TNSName jdbc:oracle:thin:@<TNSName>
* Example: jdbc:oracle:thin:@GL
* --Support for TNSNames was added in the driver release 10.2.0.1
*/
//連接數據庫驅動
//String driver = "oracle.jdbc.driver.OracleDriver";
//連接數據的具體信息,如IP地址接口,SID
//String url="jdbc:oracle:thin:@172.24.22.1:1521:g2shjdb";
//String url2="jdbc:oracle:thin:@172.24.22.1:1521:g2shjdb";
Class.forName(driver);
//連接數據庫
Connection conn=DriverManager.getConnection(url, userid, password);
//取消自動提交功能
conn.setAutoCommit(false);
return conn;
}
public void disConnection(Connection conn) throws ClassNotFoundException, SQLException
{
//disconnection斷掉與數據庫的連接
conn.close();
}
public void forEach(Connection conn, ArrayList<HashMap<String, Object>> dlist, int li_count)
{
/*conn 传入的连接,
dlist为传入的数组,
li_count为传入的Table的列数*/
System.out.println("-------forEach-------");
for(HashMap<String, Object> flist:dlist)
{
//依顺序从HashMap中取出资料,但下标要与前面写入的一致
for(int col=1; col<= li_count; col++)
{
System.out.print(flist.get(String.valueOf(col)));
}
System.out.println("");
}
System.out.println("--end-----forEach-------");
}
}
import java.sql.*;
import java.util.*;
public class DbData {
public static void main(String [] args) throws ClassNotFoundException, SQLException
{
//連接數據庫的驅動
String driver = "oracle.jdbc.driver.OracleDriver";
//連接數據的具體信息,如IP地址接口,SID
String url="jdbc:oracle:thin:@172.24.22.1:1521:g2shjdb";
//String url="jdbc:oracle:thin:@//172.24.22.1:1521/TESTS10";
Object factno = null,brandno = null,bname = null,mark = null;
DbData dbget = new DbData();
Connection conn = dbget.getconnection(driver,url,"nbmis","nbmis");
//設置連接數據庫的sql,? 表示需傳入參數
PreparedStatement pst = conn.prepareStatement("select * from brandwei where fact_no =? and brand_no =?");
//設定第一個參數值
pst.setString(1, "0236");
//設定第二個參數值
pst.setString(2, "NB");
//真正執行查詢語句,并把結果放入ResultSet游標中
ResultSet reader = pst.executeQuery();
while(reader.next())
{
//String bname = (String) ResultSet.getString(1);
factno = reader.getObject(1);
brandno = reader.getObject(2);
bname = reader.getObject(3);
mark = reader.getObject(4);
System.out.print((String)factno + ' ' + (String)brandno + ' ' + (String)bname + ' ' + (String)mark);
}
//關閉游標
reader.close();
//System.out.println("----------------------------");
//delete 掉數據庫中的資料
PreparedStatement pst2 = conn.prepareStatement("delete from brandwei where fact_no =? and brand_no =?");
pst2.setString(1, "0236");
pst2.setString(2, "NB");
//返回刪除了多少行,如沒有刪除到則返回0
int delcount = pst2.executeUpdate();
System.out.println("delete count=" + delcount);
//update資料到數據庫中
PreparedStatement pst3 = conn.prepareStatement("update brandwei set mark_no='W' where fact_no =? and brand_no =?");
pst3.setString(1, "0236");
pst3.setString(2, "WR");
int updcount = pst3.executeUpdate();
System.out.println("update count=" + updcount);
//insert into 資料到數據庫中
PreparedStatement pst4 = conn.prepareStatement("insert into brandwei(fact_no, brand_no, brand_nm, mark_no) values('0236', ?, ?, ?)");
pst4.setString(1, "NB");
pst4.setString(2, "NEW BALANCE");
pst4.setString(3, "test");
int intcount = pst4.executeUpdate();
System.out.println("insert into count=" + intcount);
//設置連接數據庫的sql,? 表示需傳入參數
PreparedStatement pst8 = conn.prepareStatement("select * from brandwei where fact_no =?");
//設定第一個參數值
pst8.setString(1, "0236");
//真正執行查詢語句,并把結果放入ResultSet游標中
ResultSet reader8 = pst8.executeQuery();
while(reader8.next())
{
//String bname = (String) ResultSet.getString(1);
factno = reader8.getObject(1);
brandno = reader8.getObject(2);
bname = reader8.getObject(3);
mark = reader8.getObject(4);
//System.out.print((String)factno + ' ' + (String)brandno + ' ' + (String)bname + ' ' + (String)mark);
}
//關閉游標8
reader8.close();
HashMap<String,Object> hm = new HashMap<String,Object>();
/*向集合中添加指定的键值对*/
hm.put("11", "test map1!");
hm.put("22", "test map222222!");
//遍歷方法1
Iterator<String> iterator = hm.keySet().iterator();
while(iterator.hasNext()) {
System.out.println(hm.get(iterator.next()));
}
//遍歷方法2
Collection<Object> c = hm.values();
for(Iterator<Object> it=c.iterator();it.hasNext();){
System.out.println(it.next());
}
//遍歷方法3
Set<Map.Entry<String, Object>> set=hm.entrySet();
for(Iterator<Map.Entry<String, Object>> it=set.iterator();it.hasNext();){
Map.Entry<String, Object> mapEnter=it.next();
System.out.println("key="+mapEnter.getKey()+",value="+mapEnter.getValue());
}
//試驗多態性
List list = new ArrayList();
ArrayList arrayList = new ArrayList();
List a=new ArrayList();
//list.trimToSize(); //错误,没有该方法。ArrayList特有的方法
list.clear();
arrayList.trimToSize(); //ArrayList里有该方法。
ArrayList<Integer> s = new ArrayList<Integer>();
s.add(600);
s.add(100);
s.add(200);
//使用for-each
for(int lta:s)
{
System.out.println(lta);
}
/*此為023A數據庫factory_old檔資料移到0236數據庫factory_old檔中*/
int li_count;
int li_map = 1;
//設置連接數據庫的sql,? 表示需傳入參數
PreparedStatement apst = conn.prepareStatement("select * from factory_old where trans_code =?");
//設定第一個參數值
apst.setString(1, "N");
//真正執行查詢語句,并把結果放入ResultSet游標中
ResultSet readera = apst.executeQuery();
//ResultSetMetaData類保存了所有ResultSet类对象中关于字段等元数据信息,并提供许多方法来取得这些信息。
ResultSetMetaData rsmd = apst.getMetaData();
li_count = rsmd.getColumnCount();
System.out.println("factory_old的列數=" + li_count);
ArrayList<HashMap<String, Object>> dlist = new ArrayList<HashMap<String, Object>>();
while(readera.next())
{
HashMap<String, Object> dmap = new HashMap<String, Object>();
//把資料寫入map當中
for(li_map= 1; li_map <= li_count; li_map++)
{
dmap.put(String.valueOf(li_map),readera.getObject(li_map));
System.out.print(String.valueOf(li_map) + "=" + dmap.get(String.valueOf(li_map)) + " ");
}
dlist.add(dmap);
System.out.println("");
}
//關閉游標
readera.close();
//disconnection斷掉與數據庫的連接
dbget.disConnection(conn);
//連接第二個數據庫S10
String driver2 = "oracle.jdbc.driver.OracleDriver";
//連接數據的具體信息,如IP地址接口,SID
String url2="jdbc:oracle:thin:@172.24.22.1:1521:g2shjdb";
Connection conn2 = dbget.getconnection(driver2, url2, "s10mis", "tests10mis");
System.out.println("-------------遍歷ArrayList<HashMap<String, Object>> ------");
System.out.println("筆數:" + dlist.size());
//for-each方式处理方式
dbget.forEach(conn2, dlist, li_count);
//用iterator方式
long ll_st = System.currentTimeMillis();
Iterator<HashMap<String, Object>> itdl = dlist.iterator();
while(itdl.hasNext()) {
HashMap<String, Object> dlnMap = itdl.next();
PreparedStatement pstudb = conn2.prepareStatement("update factory_old set fact_nm =?,master_no =?,trans_code =?,stkdist_code =?,fact_f_nm =?" +
" where fact_no =?");
//insert into 資料到數據庫中
PreparedStatement pstdb = conn2.prepareStatement("insert into factory_old(fact_no, fact_nm,master_no,trans_code,stkdist_code,fact_f_nm) " +
"values(?, ?, ?, ?, ?, ?)");
//把值依順序從dlnMap中取出來
for(li_map= 2; li_map <= li_count; li_map++)
{
System.out.print(dlnMap.get(String.valueOf(li_map)));
pstdb.setString(li_map, (String)dlnMap.get(String.valueOf(li_map)));
pstudb.setString(li_map-1, (String)dlnMap.get(String.valueOf(li_map)));
}
pstdb.setString(1, (String) dlnMap.get("1"));
pstudb.setString(li_count, (String) dlnMap.get("1"));
int updbcount = pstudb.executeUpdate();
System.out.println("update factory_old=" + updbcount);
//先update,無則insert into
if(updbcount <= 0 )
{
int dbintcount = pstdb.executeUpdate();
System.out.println("insert into factory_old=" + dbintcount);
}
/*Iterator<String> itlMap = dlnMap.keySet().iterator();
while(itlMap.hasNext())
{
System.out.println(dlnMap.get(itlMap.next()));
}*/
pstudb.close();
pstdb.close();
System.out.println("----------------------------------------");
}
System.out.println("直接insert使用毫秒=" + (System.currentTimeMillis() - ll_st));
/*long ll_stad = System.currentTimeMillis();
//批量 insert into 資料到數據庫中
PreparedStatement pstad = conn2.prepareStatement("insert into factory_old(fact_no, fact_nm,master_no,trans_code,stkdist_code,fact_f_nm) " +
"values(?, ?, ?, ?, ?, ?)");
Iterator<HashMap<String, Object>> itdlab = dlist.iterator();
while(itdlab.hasNext()) {
HashMap<String, Object> dlnMap = itdlab.next();
//把值依順序從dlnMap中取出來
for(li_map= 1; li_map <= li_count; li_map++)
{
pstad.setString(li_map, (String)dlnMap.get(String.valueOf(li_map)));
}
//addBatch();执行后暂时记录此条插入
pstad.addBatch();
}
//执行后开始批量插入数据
pstad.executeBatch();
System.out.println("批處理使用毫秒=" + (System.currentTimeMillis() - ll_stad));*/
conn2.commit();
//disconnection斷掉與數據庫2的連接
dbget.disConnection(conn2);
}
public Connection getconnection(String driver, String url, String userid, String password) throws ClassNotFoundException, SQLException
{
/*格式一: Oracle JDBC Thin using a ServiceName jdbc:oracle:thin:@//<host>:<port>/<service_name>
* Example: jdbc:oracle:thin:@//192.168.2.1:1521/xifenfei
* 格式二: Oracle JDBC Thin using an SID jdbc:oracle:thin:@<host>:<port>:<SID>
* Example: jdbc:oracle:thin:192.168.2.1:1521:xff --注意这里的格式,@后面有//, 这是与使用SID的主要区别。
* 格式三:Oracle JDBC Thin using a TNSName jdbc:oracle:thin:@<TNSName>
* Example: jdbc:oracle:thin:@GL
* --Support for TNSNames was added in the driver release 10.2.0.1
*/
//連接數據庫驅動
//String driver = "oracle.jdbc.driver.OracleDriver";
//連接數據的具體信息,如IP地址接口,SID
//String url="jdbc:oracle:thin:@172.24.22.1:1521:g2shjdb";
//String url2="jdbc:oracle:thin:@172.24.22.1:1521:g2shjdb";
Class.forName(driver);
//連接數據庫
Connection conn=DriverManager.getConnection(url, userid, password);
//取消自動提交功能
conn.setAutoCommit(false);
return conn;
}
public void disConnection(Connection conn) throws ClassNotFoundException, SQLException
{
//disconnection斷掉與數據庫的連接
conn.close();
}
public void forEach(Connection conn, ArrayList<HashMap<String, Object>> dlist, int li_count)
{
/*conn 传入的连接,
dlist为传入的数组,
li_count为传入的Table的列数*/
System.out.println("-------forEach-------");
for(HashMap<String, Object> flist:dlist)
{
//依顺序从HashMap中取出资料,但下标要与前面写入的一致
for(int col=1; col<= li_count; col++)
{
System.out.print(flist.get(String.valueOf(col)));
}
System.out.println("");
}
System.out.println("--end-----forEach-------");
}
}
发表评论
-
Java 学习步骤step
2018-04-03 08:38 413Java开发,要掌握什么技 ... -
编写高性能Java代码的最佳实践
2018-02-13 10:20 340编写高性能Java代码的最佳实践 转:http://www.i ... -
Java url
2016-08-11 08:16 310--free book http://bookboon.com ... -
Java程序员修炼之路
2016-07-08 08:30 324Java程序员修炼之路 轉 http://geek.csdn. ... -
database
2016-05-10 16:20 342database -
DbConnection
2016-05-07 09:32 298package dbconnection; //import ...
相关推荐
DbData查看工具是一款专为COOLPAD手机设计的实用软件,它主要服务于手机开发者和维修技术人员,便于他们在个人计算机上查看并操作手机内的隐藏文件。这个工具的强大之处在于,它能够帮助用户访问那些通常不易触及...
【标题】"shujuku.rar_dbhomewdb/dbdata_完美_完美国际" 暗示了这是一个与“完美国际”游戏相关的数据库文件压缩包,其中可能包含了游戏服务器的数据库数据。"dbhomewdb/dbdata" 是数据库的路径,表明数据存储在名为...
刺客信条的一个修改器,在游民星空下的,只是修改器
三星p100用的 kan qin zi ji de xin hao
Operation UnKnown(double *dbData, int iSize, char choice) { switch (choice) { case 'd': return GetMin; case 'x': return GetMax; case 'p': return GetAverage; default: return NULL; } } int ...
mysqldump -uroot -p123456 --all-databases > /data/dbdata/mysqlbak/`date +%Y%m%d`.sql # 删除超过7天的备份,但保留每月10号、20号、30号的备份 find /data/dbdata/mysqlbak/ -mtime +7 -name '*[1-9].sql' -...
List<DataRow> dbData = GetDataFromDatabase(); // 创建Excel文件 using (var package = new ExcelPackage()) { // 添加工作表 var worksheet = package.Workbook.Worksheets.Add("Sheet1"); // 填充数据 int...
### 数据库数据库概述 #### 数据库基本概念与性质 数据库,作为现代信息技术的重要组成部分,扮演着数据管理和存储的核心角色。数据库系统,不仅是一种用于存储、维护和检索数据的软件系统,更是一种集成化的数据...
sudo -u postgres /home/y/pgsql/bin/pg_ctl start -D /home/y/pgsql/dbdata -m fast & ``` ##### 5.4 创建数据库实例 ```bash sudo -u postgres /home/y/pgsql/bin/createdb URTCluster ``` ##### 5.5 配置...
sudo -u postgres /home/y/pgsql/bin/pg_ctl start -D /home/y/pgsql/dbdata -m fast & ``` ##### 6. 创建数据库并启用本地连接 ```bash sudo -u postgres /home/y/pgsql/bin/createdb URTCluster ``` ##### 7. ...
d访问地址http://localhost:8080访问phpmyadmin用户访问用户mysql密码mysql主机mysql根访问权限用户root密码root主机mysql访问地址...数据./docker/mysql/dbdatapostgresql数据./docker/postgresql/dbdata
标题中的"database.rar"表明这是一个压缩包文件,通常包含与数据库相关的组件。描述中提到的“一个数据数据文件和一个数据库日志文件,是sqlserver 2000 的版本”揭示了压缩包内的具体内容,即两个关键文件:db_JXC_...
数据文件应挂载在/dbdata,目录为/dbdata/dmdata。根据项目需求,磁盘空间可能需要200GB或更多。确保设置正确的权限和组,例如:dmdba:dinstall。 3. **备份文件管理** 备份文件挂载在/dbbak,按照4:1的比例分配/...
Data的数据 construct_dataset_attribute.py 生成Sim_Data的数据 triple_clean.py 生成三元组数据 load_dbdata.py 将数据导入mysql dbModelParams文件夹需要下载BERT的中文配置文件:chinese_L-12_H-768_A-12Output...
这里是一个mybates入门的小例子,里面的dbData.properties是我的数据库连接的一些字符串需要根据个人的情况进行修改成为自己的mysql的配置连接,同时需要自己建立一个usermanegr数据库,里面有一张t_user的表格,...
KBQA-BERT基于知识图谱的问答系统命名实体识别和句子相似度在线大纲模式程序源代码数据 ... load_dbdata.py 将数据导入mysql db ModelParams文件夹需要下载BERT的中文配置文件:chinese_L-12_H-768_A-12
这里 `dbdata` 是一个双精度浮点数,`f2` 表示保留两位小数。 #### 4. 使用 `String.Format` 方法 `String.Format` 方法提供了一种灵活的方式来格式化字符串,可以方便地保留小数位数: ```csharp string result ...
client.ReadDB(1, 0, dbData.Length, dbData); ``` 写入数据到PLC则使用WriteDB方法: ```csharp byte[] writeData = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; client.WriteDB(1, 0, writeData.Length, ...
然后修改MySQL配置文件`/etc/my.cnf`,将数据目录设置为共享存储的路径`/dbdata/mysql`。 **4. Heartbeat安装** Heartbeat的安装过程包括解压、编译和安装。创建`haclient`组和用户,然后配置Heartbeat的三个核心...