我想确定VBA中特定日期不同国家/地区的GMT/UTC(包括夏令时)的时间偏差.有任何想法吗?
编辑(来自自我回答):
谢谢0xA3.我快速阅读链接页面.我假设您只能获得运行Windows的本地的GMT偏移量:
ConvertLocalToGMT
DaylightTime
GetLocalTimeFromGMT
LocalOffsetFromGMT
SystemTimeToVBTime
LocalOffsetFromGMT
Run Code Online (Sandbox Code Playgroud)
在Java中,您可以执行以下操作:
TimeZone bucharestTimeZone = TimeZone.getTimeZone("Europe/Bucharest");
bucharestTimeZone.getOffset(new Date().getTime());
Calendar nowInBucharest = Calendar.getInstance(TimeZone.getTimeZone("Europe/Bucharest"));
nowInBucharest.setTime(new Date());
System.out.println("Bucharest: " + nowInBucharest.get(Calendar.HOUR) + ":" + nowInBucharest.get(Calendar.MINUTE));
Run Code Online (Sandbox Code Playgroud)
这意味着我可以获得不同国家(时区)的偏移量,因此我也可以得到布加勒斯特的实际时间.我可以在VBA中这样做吗?
如果我使用JPA(EclipseLink)创建表,则String类型会生成varchar2(255).我怎么能告诉JPA(通过Annotation)创建一个varchar2(20)属性.
如果我有一个List JPA创建一个BLOB(4000)但我想要一个varchar2(我的序列化对象的字符串很短)
这怎么可能?我必须手工完成吗?
我运行jetty-maven-plugin 8.0.0M2.启动后工作正常(mvn jetty:run).如果我更改源,插件会尝试热部署但由于以下错误而卡住
Duplicate fragment name: PrimeFaces for jar:file:/C:/path/to/project/webroot/WEB-INF/lib/primefaces-2.1.jar!/META-INF/web-fragment.xml and jar:file:/C:/path/to/project/webroot/WEB-INF/lib/primefaces-2.1.jar!/META-INF/web-fragment.xml
Run Code Online (Sandbox Code Playgroud)
它适用于插件版本7.2.0.我正在升级,因为我需要el-api 2.2.有任何想法吗?谢谢
马塞尔
如果我像这样使用带有MigLayout的JTextArea:
MigLayout thisLayout = new MigLayout("", "[][grow]", "[]20[]");
this.setLayout(thisLayout);
{
jLabel1 = new JLabel();
this.add(jLabel1, "cell 0 0");
jLabel1.setText("jLabel1");
}
{
jTextArea1 = new JTextArea();
this.add(jTextArea1, "cell 0 1 2 1,growx");
jTextArea1.setText("jTextArea1");
jTextArea1.setLineWrap(false);
}
Run Code Online (Sandbox Code Playgroud)
然后,当调整窗口大小时,JTextArea会完美地缩小和缩小.当我将linewrap设置为true时,当我再次缩小窗口时,JTextArea不会缩小.我非常感谢任何帮助.谢谢
马塞尔
我<c:foreach>在我的jsf应用程序中使用迭代人员列表.我不使用,<ui:repeat>因为每个人都有自己的标签(primefaces).JSF英雄'BalusC'已经在这一个链接上帮助了我.现在我尝试保存(回发)数据.这不起作用<c:forEach>,从不调用Person对象的approriate setter.随着<ui:repeat>它工作.显然我没有理解这两个标签之间的区别,所以我会嘲笑一些启示.
谢谢
马塞尔
嗨,我想迭代一个person-object列表,并在每个人的标签中显示数据.我试过了:
<p:tabView>
<ui:repeat ...>
<p:tab title="#{expression}>
</ui:repeat>
</p:tabView>
Run Code Online (Sandbox Code Playgroud)
这不起作用.任何帮助赞赏
马塞尔
我有一个关于Glassfish中JPA持久性的问题.情况:我有一个与SupplierAddress具有1:n双向关系的Supplier类.我希望有以下行为:如果我从Supplier对象的List中删除SupplierAddress对象并通过merge(supplierobject)更新它,则应删除SupplierAddress tupel/object.是否有注释确实像这样配置它或我必须手动删除它.任何帮助将非常感激.
问候
马塞尔
嗨,我得到以下代码:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:c="http://java.sun.com/jsp/jstl/core"
>
<h:body>
<c:forEach items="#{backingBean.personList}" var="person">
<h:outputText value="#{person.name}" />
</c:forEach>
</h:body>
</html>
Run Code Online (Sandbox Code Playgroud)
这失败了:
java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.LoopTagStatus
Run Code Online (Sandbox Code Playgroud)
我使用jstl-impl-1.2.jar.有人能帮我这个吗?谢谢
马塞尔
我使用oracle.jdbc.pool.OracleDataSource进行连接池.我希望游泳池检查连接是否未正确关闭并将其赶上.我尝试了以下方法:
ods = new OracleDataSource();
ods.setConnectionCachingEnabled(true);
ods.setConnectionCacheName(CACHE_NAME);
Properties cacheProps = new Properties();
cacheProps.setProperty("MinLimit", Integer.toString(1));
cacheProps.setProperty("MaxLimit", Integer.toString(6));
cacheProps.setProperty("InitialLimit", "1");
cacheProps.setProperty("AbandonedConnectionTimeout", "2");
ods.setConnectionCacheProperties(cacheProps);
Run Code Online (Sandbox Code Playgroud)
我跟这样的活动连接:
occm = OracleConnectionCacheManager.getConnectionCacheManagerInstance();
occm.getNumberOfActiveConnections(CACHE_NAME);
Run Code Online (Sandbox Code Playgroud)
如果我不关闭应用程序中的连接,那么池最多只能填充6个,所以
cacheProps.setProperty("AbandonedConnectionTimeout", "2");
Run Code Online (Sandbox Code Playgroud)
不管用.为什么?
任何提示都将不胜感激
我想以编程方式设置clientIds来显示不同的FacesMessages.在我看来,我用过
<h:outputText value="warnMessages #{facesContext.getMessageList('warnMessages')}" />
<h:outputText value="validationMessages #{facesContext.getMessageList('validationMessages')}" />
Run Code Online (Sandbox Code Playgroud)
用于调试.消息都在那里.但...
<h:messages for="warnMessages" />
<h:message for="warnMessages" />
Run Code Online (Sandbox Code Playgroud)
不显示任何内容.只要
<h:messages />
Run Code Online (Sandbox Code Playgroud)
作品.但是我希望将不同的消息框一起显示出来.我怎样才能做到这一点?谢谢
马塞尔
我是Java EE的新手.我试着运行一些第一个例子(JPA).我正在使用Glassfish v3.麻烦的是我没有让App Server注入EntityManager.听到了一个例子http://www.adam-bien.com/roller/abien/entry/ejb_3_persistence_jpa_for ,我用JSP客户端进行了扩展.
实体:
package beans;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class Book {
@Id
@GeneratedValue
private Long id;
private String title;
private String subtitle;
public Book() {
}
public Book(String title) {
this.title = title;
}
}
Run Code Online (Sandbox Code Playgroud)
BookService接口:
package beans;
import javax.ejb.Local;
@Local
public interface BookService {
Book createOrUpdate(Book book);
void remove(Book book);
Book find(Object id);
}
Run Code Online (Sandbox Code Playgroud)
BookServiceBean:
package beans;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@Stateless
public class BookServiceBean implements BookService { …Run Code Online (Sandbox Code Playgroud)