我收到以下错误
OpenSSL::SSL::SSLError in ProfilesController#httpwork
SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A
Run Code Online (Sandbox Code Playgroud)
这是我在profiles_controller.rb中的代码
def httpwork
require "net/http"
require "uri"
require "openssl"
http = Net::HTTP.new("00.000.00.000", 0000)
http.use_ssl = true
http.ssl_version = :SSLv3
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
request = Net::HTTP::Get.new("profileTest")
response = http.request(request)
end
Run Code Online (Sandbox Code Playgroud)
快速注意,主机/端口号是隐藏的,但是格式是这样的(不像“ stackoverflow.com/question”)
在httpwork.html.erb中
<h1>Profiles#httpwork</h1>
<%= @response.body %>
Run Code Online (Sandbox Code Playgroud)
这是完整的堆栈跟踪
C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:918:in
connect'
C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:918:in
block in connect'
C:/Ruby200-x64/lib/ruby/2.0.0/timeout.rb:52:in timeout'
C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:918:in
connect'
C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:862:in do_start'
C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:851:in
start'
C:/Ruby200-x64/lib/ruby/2.0.0/net/http.rb:1367:in request'
app/controllers/profiles_controller.rb:20:in
httpwork'
actionpack (4.1.2) lib/action_controller/metal/implicit_render.rb:4:in send_action'
actionpack (4.1.2) lib/abstract_controller/base.rb:189:in
process_action'
actionpack (4.1.2) lib/action_controller/metal/rendering.rb:10:in process_action' …
我正在尝试实现一个可以识别数据库更改通知(Oracle)的事件侦听器。根据参考网站,它说当EXAMPLE表中发生变化时,事件将触发并打印ROW_ID。我希望这个项目运行,它应该给我一条消息“给我一些东西!” 如果我手动在数据库中插入/更新数据。但是,据我了解,该代码无论如何都会终止,因为没有可以被事件中断的无限循环。如果我错了,请纠正我。
附加问题]
通过将OracleConnection.DCN_NOTIFY_ROWIDS设置为 true,它将通知每个事件,包括插入、更新、删除。我对么?我对“数据库更改事件将包括行级详细信息,例如操作类型和 ROWID”的含义感到困惑
我的代码:
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import oracle.jdbc.OracleConnection;
import oracle.jdbc.OracleDriver;
import oracle.jdbc.OracleStatement;
import oracle.jdbc.dcn.DatabaseChangeEvent;
import oracle.jdbc.dcn.DatabaseChangeListener;
import oracle.jdbc.dcn.DatabaseChangeRegistration;
public class DBTest {
static final String USERNAME = "username";
static final String PASSWORD = "password";
static String URL = "jdbc:oracle:thin:@url:port/name";
public static void main(String[] args) {
DBTest oracleDCN = new DBTest();
try {
oracleDCN.run();
} catch (Exception ex) {
ex.printStackTrace();
}
}
private void …
Run Code Online (Sandbox Code Playgroud) 我有以下依赖
项目A(由我拥有)使用
项目B的用途
项目C的用途
项目A调用项目B的方法,该方法将调用项目C的方法,然后将值返回给B,然后返回A
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-655535.0.0.0" newVersion="XX" />
</dependentAssembly>
Run Code Online (Sandbox Code Playgroud)
我试图在项目A上使用程序集绑定重定向。如果我将“ newVersion”设置为9.0,则代码会抱怨(缺少Newtonsoft.jSon.dll 4.5库)。如果我将“ newVersion”设置为4.5,则会发生相同的情况,然后会丢失Newtonsoft.Json.dll 9.0库错误。我也尝试了8.0的“ newVersion”值。看起来很简单,我认为重定向应该可以解决问题。有什么好的解决方案?项目A,项目B和项目C是否应具有相同版本的Newtonsoft.Json.dll?
提前致谢..
我实现了一个返回clob数据类型的函数,我想在DBMS Output 中打印结果。不幸的是,我收到ORA-06502: PL/SQL: numeric or value error,我认为这是由于 DBMS_OUTPUT 的大小。
这是代码。
DECLARE
TYPE tp_col_array IS TABLE OF varchar2(32767);
FUNCTION my_fn (
p_in_proc_date IN varchar2)
RETURN clob AS
vr_output_str clob;
BEGIN
-- Detailed code hidden due to privacy. Sorry
RETURN vr_output_str;
EXCEPTION
WHEN LOGIN_DENIED
THEN
DBMS_OUTPUT.PUT_LINE('Invalid username/password: logon denied');
RETURN 'TEST Terminated';
END my_fn;
BEGIN
DBMS_OUTPUT.PUT_LINE(my_fn('31-AUG-14'));
END;
Run Code Online (Sandbox Code Playgroud)
这里有一些可以帮助您理解这个问题的内容
1) 添加了以下内容来设置缓冲区的大小不受限制,但没有用..
DBMS_OUTPUT.ENABLE(NULL);
Run Code Online (Sandbox Code Playgroud)
或者
set serveroutput on size unlimited;
Run Code Online (Sandbox Code Playgroud)
相关链接:http://www.oracle-developer.net/display.php?id=327
2)值得注意的是,vr_output_str的大小是75387,这就是为什么返回类型为CLOB …
例如.
Math.Round(2.314, 2) //2.31
Math.Round(2.301, 2) //2.3 , but I want this as 2.30
Run Code Online (Sandbox Code Playgroud) Default.aspx.cs
WCFService.Service1Client client = new WCFService.Service1Client();
string stream = client.JsonSerializeFromDatabase();
client.Close();
WCFService.Service1Client client2 = new WCFService.Service1Client();
foreach (WCFService.Person in client2.JsonDeserializeFromDatabase(stream))
Run Code Online (Sandbox Code Playgroud)
Service1.svc.cs
public IList<Person> JsonDeserializeFromDatabase(string value)
{
MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(value));
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(List<Person>));
IList<Person> tableData = (IList<Person>)ser.ReadObject(ms);
ms.Close();
ms.Dispose();
return tableData;
}
Run Code Online (Sandbox Code Playgroud)
IService1.cs
[OperationContract]
IList<Person> JsonDeserializeFromDatabase(string value);
Run Code Online (Sandbox Code Playgroud)
服务器Web.config
<httpRuntime maxRequestLength="8192"/>
</system.web>
...
<system.serviceModel>
<services>
<service name="TestWCF.Service1" behaviorConfiguration="TestWCF.Service1Behavior">
<endpoint address="" binding="wsHttpBinding" contract="TestWCF.IService1">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="TestWCF.Service1Behavior">
<serviceMetadata …
Run Code Online (Sandbox Code Playgroud) wcf httpresponse wcf-binding wcf-data-services json-deserialization
如何在不使用单元格索引的情况下从gridview获取单元格值?假设我表中的第一列名称是"RowNumber".
而不是使用
string name = GridView1.Rows[0].Cells[0].Text;
Run Code Online (Sandbox Code Playgroud)
就像是
string name = GridView1.Rows[0].Cells["RowNumber"].Text;
Run Code Online (Sandbox Code Playgroud) 比方说,*必须跟着&.例如,
string asd = "Mother*&Mother*&Son";
// which is "Mother+ "*&" + "Mother" + "*&" + "Son"
// This is correct string.
Run Code Online (Sandbox Code Playgroud)
不好的例子,
string asd = "Mother*Mother*&Son";
string asf = "Mother**&Mother*&Son";
string asg = "Mother*&*Mother*&Son";
Run Code Online (Sandbox Code Playgroud)
如何在C#中检查字符串是否正确?
编辑
基于你们介绍的正则表达式的使用,我有一个附带问题.我实际上使用逗号(,)而不是星号(*)和引号(")代替&符号(&).在C#中,(让我使用其中一个人的例子)
Regex.IsMatch("Mother,\",Mother,\"Son", @"\,(?!")")
//won't work.. any idea?
Run Code Online (Sandbox Code Playgroud)
我也试过了
Regex.IsMatch("Mother,\",Mother,\"Son", @"\,(?!\")")
//not work, neither
Run Code Online (Sandbox Code Playgroud) [解释]
如果我想创建一个属于模式'A'的函数,我的理解是我需要在模式'A'中创建包,并实现函数.(如果还有其他办法,请纠正我).
如果我试图使用脚本文件创建一个函数(例如.新图库 - > SQL文件(数据库文件)来创建untitled.sql),我会感到困惑,因为该函数不属于任何模式,它将被存储在全球.
[问题]
1)如何创建函数属于使用脚本的模式'A'?
2)存储在全局的函数无法访问模式表,我该如何解决?
select SEQUENCE_OWNER, SEQUENCE_NAME from ALL_SEQUENCES
Run Code Online (Sandbox Code Playgroud)
我们假设上面的代码会给我以下结果.
<Table Name: ALL_SEQUENCES>
SEQUENCE_OWNER SEQUENCE_NAME
schema1 table1_name_seq
schema1 table2_name_seq
schema2 table1_name_seq
Run Code Online (Sandbox Code Playgroud)
我很确定每个序列都有一个对应的父表,序列用于该表.所以,我想使用sequence_name找到父表.例如,如果我知道具有序列所有者schema1的序列名table1_name_seq,我应该找到表名schema1.table1.
建议不要使用SUBSTRING或REPLACE函数重新格式化字符串,因为sequence_name不遵循"良好一致的命名标准",我无权更改它.
我找不到有关此事的任何信息.非常感谢您的帮助!
Java本身是否支持缓存?由于政策原因,我不允许使用第三者框架或库,因此我想创建自己的缓存来存储数据库数据。当我尝试通过Google进行研究时,我只会看到那些JCS,EhCache,Hibernate等。
例如,这是C#的缓存
-http
: //msdn.microsoft.com/zh-cn/library/system.web .caching.cache(v = vs.110).aspx
如果我写错了,请纠正我。
我试图获取my_table的所有列名,并希望使用my_fn将其作为字符串.例如,假设my_table包含名为"year","month","day"的列.使用all_tab_cols表获取此列名,并将其存储到tmp集合中.使用for循环,我希望使用my_fn将这些列名称设置为"月,年,日".目前,我收到以下错误.
错误日志 - 这是我作为错误得到的
SQL Error: ORA-22905: cannot access rows from a non-nested table item
22905. 00000 - "cannot access rows from a non-nested table item"
*Cause: attempt to access rows of an item whose type is not known at
parse time or that is not of a nested table type
*Action: use CAST to cast the item to a …
Run Code Online (Sandbox Code Playgroud) oracle ×5
c# ×4
plsql ×4
sql ×3
java ×2
app-config ×1
asp.net ×1
c#-4.0 ×1
caching ×1
casting ×1
dbms-output ×1
dll ×1
gridview ×1
httprequest ×1
httpresponse ×1
ojdbc ×1
oracle11g ×1
rounding ×1
ruby ×1
string ×1
wcf ×1
wcf-binding ×1