小编Ana*_*nas的帖子

Metabase Filters示例

在此输入图像描述我使用与Mysql集成的配置数据库用于报告目的.我浏览了文档,但无法找到任何解释如何在基于SQL的问题中实现过滤器的示例.

我发现的唯一例子是关于日期范围和字段过滤器,而不是文本和数字.

任何人都可以提供有关如何使用文本过滤器的文档或任何示例.

我正在使用元数据库版本v0.24.2

我试图运行的查询就是这个

 SELECT  @a:=@a+1 "Serial Number", ssk_transaction.transactionId AS "TranId",   
t2.typeName AS "Transaction Type",  
ssk_transaction.createdTime AS "GenDate", t3.deviceName AS "Machine Name",  
 t3.deviceLocation AS "Machine Location", t9.eventApiName AS 'API Name' ,  
t8.vendorResultCode AS 'Last API Response',  
(SELECT createdTime FROM ssk_transaction_event_detail t4 WHERE t4.transactionId  
 = ssk_transaction.transactionId ORDER BY id DESC LIMIT 1) AS "Last API Called",  
(SELECT IFNULL(SUM(t5.itemName * t4.itemCount), 0) FROM  
 ssk_transaction_cash_detail t4  
LEFT JOIN ssk_inventory_item t5 ON (t4.itemId = t5.itemId)  
LEFT JOIN ssk_inventory_category t10 ON (t5.categoryId = t10.categoryId) …
Run Code Online (Sandbox Code Playgroud)

java mysql metabase

15
推荐指数
1
解决办法
2176
查看次数

使用日历 JSF primefaces 进行第二天检查

我正在处理一个需求。我需要做的是从数据库中检索最后输入的日期,增加它,然后检查这一天是否是星期六。我陷入困境的部分是如何检查第二天是否是星期六我正在使用 primefaces 3.5 jsf2.1 apache tomcat 7.0.39

FacesContext context = FacesContext.getCurrentInstance();
    Map requestMap = context.getExternalContext().getRequestParameterMap();
    String value = (String) requestMap.get("id");
    Integer id = Integer.parseInt(value);
    SimpleDateFormat sdf= new SimpleDateFormat();
    String sector=new String();
    setFund(new Fund());
    for(Map row:fund_grid){
        Integer edit_id=(Integer.parseInt((String) row.get("fund_id")));
        if(id.equals(edit_id)){
            sector=(String) row.get("fund_sector_label");
            mfp.setFund_id(Integer.parseInt( (String) row.get("fund_id")));
            fund.setFund_id( (String) row.get("fund_id"));
            setValidity_date(request_invoker.select_validity_date());
            try {
                Date ndate=sdf.parse((String) getValidity_date().get(0).get("validitydate"));
Run Code Online (Sandbox Code Playgroud)

// 这里的日期是从数据库值 15-11-2013 中退休的

//现在增加一天

                Calendar c = Calendar.getInstance();
                c.setTime(ndate);
                c.add(Calendar.DATE, 1);
                fund.setNav_entry_date(c.getTime());
Run Code Online (Sandbox Code Playgroud)

//这就是我被困的地方,我不知道如何检查日期是否是星期六

            if(fund.getNav_entry_date().equals(Calendar.SATURDAY))
                {
                c.add(Calendar.DATE, 2);
                fund.setNav_entry_date(c.getTime());
                }
                else
                {
                    fund.setNav_entry_date(c.getTime());

                }
            } catch (ParseException …
Run Code Online (Sandbox Code Playgroud)

calendar date primefaces jsf-2

5
推荐指数
1
解决办法
616
查看次数

Javamail在公​​司使用outlook

我第一次使用 javamail,遇到了一些我不明白的异常,我在这里也看到了其他问题中的一些错误,但它们的答案对我没有帮助。这是我的代码。

        final String username = "imsan1@cdcpk.com";
        final String password = "**********";
        Properties props = System.getProperties();
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.host", "10.1.136.26");
        props.put("mail.smtp.port", "25");
        props.put( "mail.smtp.user" , username );
        props.put( "mail.smtp.password" , password );

        Session session = Session.getInstance(props,
          new SmtpAuthenticator(username, password)
          );


        try {

            Message message = new MimeMessage(session);
            message.setFrom(new InternetAddress("imsan1@cdcpk.com"));
            message.setRecipients(Message.RecipientType.TO,
                InternetAddress.parse("immni1@cdcpk.com"));
            message.setSubject("Testing Subject");
            message.setText("Dear Mail Crawler,"
                + "\n\n No spam to my email, please!");

            Transport.send(message);

            System.out.println("Done");

        } catch (MessagingException e) {
            throw new RuntimeException(e);
        }
    }
Run Code Online (Sandbox Code Playgroud)

SMTP验证器

import javax.mail.Authenticator;
import …
Run Code Online (Sandbox Code Playgroud)

java jakarta-mail

5
推荐指数
1
解决办法
647
查看次数

运行 jar 时无法确定数据库类型 NONE 的嵌入式数据库驱动程序类

正如问题标题中提到的,我面临问题Cannot determine embedded database driver class for database type NONE。我构建的应用程序是在 spring boot 上构建的,当我在 intellij 中运行代码时工作正常。

我关注了有关同一异常的几个问题,他们建议我需要spring.datasource在 application.properties 文件中添加属性。我已经有了它们,但仍然面临同样的问题。当我使用 intellij 的工件创建 jar 文件,然后通过以下命令运行它时,会出现此问题。 java - jar myJar.jar

我的 application.properties 文件

# ===============================
# = DATA SOURCE
# ===============================
spring.datasource.url = jdbc:mysql://localhost:3306/db_wssmith?useSSL=false
spring.datasource.username = 
spring.datasource.password = 
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
Run Code Online (Sandbox Code Playgroud)

运行jar时出现错误日志

ERROR org.springframework.boot.SpringApplication - Application startup failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' …

java datasource jar intellij-idea spring-boot

5
推荐指数
1
解决办法
1万
查看次数

通过Intellij Hibernate持久性工具生成模型时,Relationship References分解表

我有一个用以下sql在mysql上创建的表

CREATE TABLE `ssk_cms_category_transaction_type_relation` (
  `categoryId` int(11) NOT NULL,
  `typeId` int(11) NOT NULL,
  `createdTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`categoryId`,`typeId`),
  KEY `FK_ssk_cms_category_transaction_type_relation1` (`typeId`),
  CONSTRAINT `FK_ssk_cms_category_transaction_type_relation` FOREIGN KEY (`categoryId`) REFERENCES `ssk_cms_content_category` (`contentCategoryId`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_ssk_cms_category_transaction_type_relation1` FOREIGN KEY (`typeId`) REFERENCES `ssk_transaction_type` (`typeId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1
Run Code Online (Sandbox Code Playgroud)

在尝试使用intellij中的休眠持久性工具生成其模型时,如果我检查显示默认关系,则会收到以下错误,任何人都可以帮助我理解这一点。我尝试使用Google搜索,但未找到解决方案在此处输入图片说明

java mysql hibernate intellij-idea models

4
推荐指数
1
解决办法
426
查看次数

致命:gpu_data_manager_impl_private.cc(439)] GPU 进程不可用。再见

我正在使用 Ubuntu 18.04 并在最新版本的 Intellij 中遇到以下异常 FATAL:gpu_data_manager_impl_private.cc(439)] GPU process isn't usable. Goodbye.错误中。尽管新的 helloworld 项目对我来说很好用,但当我打开任何远程存储库时,这在 Ultimate 和 Community 版本上都会发生。我可以成功克隆 repo,但 intellij 因此异常而崩溃

我也试过用 intellij 运行,--disable-gpu但对我不起作用。

java crash intellij-idea

4
推荐指数
3
解决办法
8706
查看次数

Primefaces p:对话框无法从p:commandLink onComplete工作

此前我的号码:渐渐调用对话妥善当我在做一个.show()关于widgetVar在其上定义.但最近在更新后它停止工作,我在浏览器中收到此错误:

网页错误详情:

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8)
Timestamp: Fri, 28 Mar 2014 04:04:49 UTC


Message: Object doesn't support this property or method
Line: 12
Char: 4302
Code: 0
URI: http://localhost:8282/OMNIVue/javax.faces.resource/primefaces.js.jsf?ln=primefaces


Message: Object doesn't support this property or method
Line: 16
Char: 1
Code: 0
URI: http://localhost:8282/OMNIVue/orders/orderSearch.jsf


Message: Could not complete the operation due to error 80020101.
Line: 81
Char: …
Run Code Online (Sandbox Code Playgroud)

jsf primefaces jsf-2

3
推荐指数
1
解决办法
5492
查看次数

使用 JpaRepository Spring-data-jpa 对子列表总数进行排序

我需要对实体进行分页和排序。

@Entity
@Table(name = "CATEGORY", catalog = "")
public class CategoryEntity {
 private CategoryEntity categoryByParentCategoryId;
 private Set<CategoryEntity> categoriesByCategoryId;


@ManyToOne(fetch = FetchType.LAZY,optional = false, cascade = CascadeType.PERSIST)
@JoinColumn(name = "PARENT_CATEGORY_ID", referencedColumnName = "CATEGORY_ID")
public CategoryEntity getCategoryByParentCategoryId() {
    return categoryByParentCategoryId;
}

public void setCategoryByParentCategoryId(CategoryEntity categoryByParentCategoryId) {
    this.categoryByParentCategoryId = categoryByParentCategoryId;
}

@OneToMany(mappedBy = "categoryByParentCategoryId", cascade = CascadeType.PERSIST)
public Set<CategoryEntity> getCategoriesByCategoryId() {
    return categoriesByCategoryId;
}

public void setCategoriesByCategoryId(Set<CategoryEntity> categoriesByCategoryId) {
    this.categoriesByCategoryId = categoriesByCategoryId;
}
Run Code Online (Sandbox Code Playgroud)

这个链接和其他堆栈溢出的答案,我发现我可以使用排序和使用分页Paging Request

Pageable size = new …
Run Code Online (Sandbox Code Playgroud)

java sorting repository spring-data-jpa spring-boot

2
推荐指数
1
解决办法
1694
查看次数