我来自SQL Server背景.MySQL中的以下等效数据类型是什么:
NVARCHAR - 为所有语言的国际多字节字符提供支持
NVARCHAR(max) - 允许很长的文本文档
我需要从一个数据库中取一个表并将其上传到另一个数据库.所以,我创建了两个单独的连接.这是我的代码
Connection connection1 = // set up connection to dbms1
Statement statement = connection1.createStatement();
ResultSet result = statement.executeQuery("select * from ............. ");
Connection connection2 = // set up connection to dbms2
// Now I want to upload the ResultSet result into the second database
Statement statement2 = connection2.createStatement("insert into table2 " + result);
statement2.executeUpdate();
Run Code Online (Sandbox Code Playgroud)
以上最后一行不起作用我该怎么做?底线是如何重用ready结果集
ResultSet是一个现成的java对象.我希望有一种方法将它添加到批次或这样的事情和executeUpdate,但不写结果集到一些临时空间(List,csv等等),并插入