我正在寻找一个查询,它将返回一个高负载的sql语句列表.我不想使用任何Oracle工具,如ADDM或AWR.我需要一个查询语句,它将返回高负载的sql语句.
所以这是一百万美元的问题。
首先,我正在Visual WebGui中开发Web应用程序。这基本上是Winforms,但是应用程序将转换为HTML5和vual..web应用程序。无论如何,我对DateTime格式有疑问。默认情况下,它是服务器计算机上的CultureInfo。
我可以像这样在web.config中覆盖它:
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="de-DE" uiCulture="de-DE"/>
Run Code Online (Sandbox Code Playgroud)
每个客户端计算机上的每个dateformat均为德语。我要制作一个Web应用程序,它将在控制面板中的客户端计算机上显示Datetime格式。
可能吗?我只是找不到解决方案。
感谢帮助,
我在那里遇到一点问题.当我想在JSF中填充DataTable时,我必须先创建一个模型,然后在我的视图中使用它.像Primefaces样品这里.
现在,我必须创建将显示来自webservice的数据的DataTable.我不知道会有多少列,而且我不知道他们的名字......你能推荐一些明智的解决方案吗?
PS.我不知道如何从webservice返回数据 - 它仍然是要确定的.
编辑
public Bean() {
columns = new ArrayList<String>();
rows = new ArrayList<Map<String, Object>>();
populateColumns(columns,4);
for(int i = 0 ; i < 6 ; i++)
{
Map<String,Object> m = new HashMap<String,Object>();
m.clear();
for(int j = 0 ; j < 4 ; j++)
{
m.put("Column" + j, "sth" + j + i);
}
rows.add(m);
}
}
private void populateColumns(List<String> list, int size) {
for(int i = 0 ; i < size ; i++)
list.add("Column" + …Run Code Online (Sandbox Code Playgroud) 请帮帮我,我想在我的Windows服务上运行log4net.简而言之 - 任务是不可能的.
首先,使用Win表单 - 工作得很好.
这是我用windows服务做的事情:
添加到程序集:
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
Run Code Online (Sandbox Code Playgroud)
我的配置:
<configSections>
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="log-file.txt" />
<param name="AppendToFile" value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c: %m%n" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="LogFileAppender" />
</root>
</log4net>
Run Code Online (Sandbox Code Playgroud)
我的课:
public class LogProvider
{
private ILog _Log;
public LogProvider(string className)
{
XmlConfigurator.Configure();
_Log = LogManager.GetLogger(className);
}
public void Info(object message)
{
_Log.Info(message);
}
}
Run Code Online (Sandbox Code Playgroud)
在主程序中:
using …Run Code Online (Sandbox Code Playgroud) 我现在正在加密algotythm,我还需要加密德语单词.所以我必须加密例如:ü,ä或ö等字符.
在里面我有一个功能:
private static byte[] getBytesArray(string data)
{
byte[] array;
System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
array = asciiEncoding.GetBytes(data);
return array;
}
Run Code Online (Sandbox Code Playgroud)
但是当数据为"ü"时,数组中返回的字节为63(所以"?").我怎么能返回ü字节?
我也尝试过:
private static byte[] MyGetBytesArray(string data)
{
byte[] array;
System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
Encoding enc = new UTF8Encoding(true, true);
array = enc.GetBytes(data);
return array;
}
Run Code Online (Sandbox Code Playgroud)
但在这种情况下,我在数组中得到2个字节:195和188.
有没有办法检查我的Glassfish是否正常看到ojdbc6.jar?
我正在使用Netbeans 7.2.1,使用JSF 2,Glassfish 3.1.2和Oracle 11g.我想连接到这个数据库.
首先,我需要在Glassfish中创建连接池.我打开localhost:4848设置5件事:
保存,重置服务器(只是肯定),ping ....和错误:类名错误或类路径未设置为:oracle.jdbc.pool.OracleDataSource
我做了什么:
首先检查ojdbc罐子.从我的Oracle目录中,我将名称中包含"ojdbc"的每个jar复制到"C:\ glassfish3\glassfish\domains\domain1\lib"中.
其次,检查网址的正确性.在Netbeans内部,切换到Services选项卡,右键单击Databases,New connection ...设置数据连接(首先我必须添加,jodbc6.jar ..所以我添加完全相同的文件 - 来自glassfish文件夹).有用!连接还可以.我查看了Netbeans数据库URL - 与我在glassfish gui中的url相同.我也用\来试过网址,但它没有帮助.
那么,还有什么呢?也许1号不行.所以这是我的问题:如何检查我的Glassfish是否正常看到ojdbc6.jar?
编辑.当我运行Glassfish时,我收到一些警告:
警告:存在多个[2] JMX MBeanServer实例,我们将使用索引[0]处的服务器:[com.sun.enterprise.v3.admin.DynamicInterceptor@704d54].
警告:正在使用的JMX MBeanServer:索引[0]中的[com.sun.enterprise.v3.admin.DynamicInterceptor@704d54]
警告:正在使用的JMX MBeanServer:索引[1]中的[com.sun.jmx.mbeanserver.JmxMBeanServer@ed312d]
我需要在我的项目中有多个Form类.因此,考虑将这些形式的所有内容放在一起,在抽象课程中.该类将具有继承Form类和接口.那样的:
public interface IMyForm
{
void Init();
}
public abstract class AMyForm : Form, IMyForm
{
void IBrowser.Init()
{
throw new NotImplementedException();
}
}
public partial class MainClass : AMyForm
{
// But here the warning is shown (That i have to add override keyword),
// but when i do, The error is shown that i cannot override from non abstract thing
public void Init()
{
}
}
Run Code Online (Sandbox Code Playgroud)
你能告诉我怎么做到的吗?
所以,首先.代码:我上课了:
public class Myobject
{
public string Code { get; set; }
public DateTime? StartDate { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
这是非常简单的来源的一部分:
MyObject mo = new MyObject();
mo.Code= "sth";
// NO action on StartDate property!
if (mo.StartDate.HasValue)
{
sc.Parameters.Add(new SqlParameter("@inStartDate", mo.StartDate.Value));
}
else
{
sc.Parameters.Add(new SqlParameter("@inStartDate", DBNull.Value));
}
Run Code Online (Sandbox Code Playgroud)
简单'如果' - Sql Server 2008,抛出错误 - 当获取null Datetime(它必须是DBNull.Value)所以我想先检查它,然后传递正确的值或DBNull.
我的问题是 - 这'如果'总是重演真实!为什么!?
还试过:
if (mo.StartDate.Value == null)
Run Code Online (Sandbox Code Playgroud)
但它总是返回false.怎么不是空的?它甚至没有创建..
那么.. 如何检查是否未分配DateTime对象?
我想实现一个datagrid,每5分钟就会填充一次.
但是,第一个代码:XAML:
<Window.Resources>
<ObjectDataProvider x:Key="_employeeProvider" ObjectType="{x:Type Brw1:EmployeeDataProvider}" />
<ObjectDataProvider x:Key="_employeeFactory" ObjectInstance="{StaticResource _employeeProvider}" MethodName="GetEmployees" />
</Window.Resources>
<Grid DataContext="{Binding Source={StaticResource _employeeFactory}}">
<DataGrid Name="_employeeDataGrid" DockPanel.Dock="Top" Margin="12,57,12,0" VerticalAlignment="Top" ItemsSource="{Binding}" AutoGenerateColumns="True">
</DataGrid>
</Grid>
Run Code Online (Sandbox Code Playgroud)
C#:
public class EmployeeDataProvider
{
public ObservableEmployee GetEmployees()
{
// This is only example
// In my project right here I will get data from database, put into the list, and fill datagrid with it.
List<UIEmployee> list = new List<UIEmployee>
{
new UIEmployee { Id = 1, FirstName = "Prajeesh2", LastName = …Run Code Online (Sandbox Code Playgroud) 我创建了一个简单的WinForms项目,没有做任何事情,只是在Form1.cs中添加了这段代码:
protected override void WndProc(ref Message m)
{
}
Run Code Online (Sandbox Code Playgroud)
就是这样.它编译,但抛出异常"创建窗口句柄时出错".就像屏幕上一样:
http://oi62.tinypic.com/ivgww5.jpg
另一件事是我有几天前创建的项目,使用WndProc没有任何例外.任何人都可以解释一下这可能是什么问题吗?
感谢帮助,
顺便说一句.堆栈跟踪:
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsFormsApplication1.Program.Main() in C:\Users\Johny\Documents\Visual Studio 2010\Projects\Temp\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext …Run Code Online (Sandbox Code Playgroud)