标签: datasource

我的UITableView不会向下滚动数据的末尾!为什么?

好吧我不知道为什么这不起作用,但我已经连接了一个tableView,我想要为每个单元格设置19项文本.

单元格填充得很好,但是当我尝试滚动时,它会向下移动,我可以看到在初始视图中看不到的单元格,它会挂起,并且不会向下滚动.它只是快速回复.真的很奇怪!

我究竟做错了什么?

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section    {
// Return the number of rows in the section.
return 19;
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}

// Configure the cell...
if(indexPath.row == 0){
    cell.textLabel.text = …
Run Code Online (Sandbox Code Playgroud)

iphone scroll datasource uitableview ipad

15
推荐指数
3
解决办法
2万
查看次数

jboss 7 AS数据源的sqlserver

我在独立模式下运行jboss并将数据源设置standalone.xml为以下内容:

<datasource jndi-name="MyDenaliDS" pool-name="MyDenaliDs_Pool" enabled="true" jta="true" 
                                                   use-java-context="true" use-ccm="true">
    <connection-url>
        jdbc:sqlserver://myip:1433;databaseName=mydb;integratedSecurity=true
    </connection-url>
    <driver>
        sqljdbc
    </driver>
    <security>
        <user-name>
            username
        </user-name>
        <password>
            password
        </password>
    </security>
</datasource>
<drivers>
    <driver name="sqljdbc" module="com.microsoft.sqlserver.jdbc">
        <driver-class>
            com.microsoft.sqlserver.jdbc.SQLServerDataSource
        </driver-class>
    </driver>                    
</drivers>
Run Code Online (Sandbox Code Playgroud)

在文件夹中%jbosshome%\modules\com\microsoft\sqlserver\jdbc\我有sqljdb4.jar以下内容module.xml:

<?xml version="1.0" encoding="UTF-8"?>
<module name="com.microsoft.sqlserver.jdbc" xmlns="urn:jboss:module:1.0">
    <resources>
        <resource-root path="sqljdbc4.jar"/> 
     </resources>
     <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/> 
     </dependencies>
</module>
Run Code Online (Sandbox Code Playgroud)

当我启动jboss时它会给我以下错误:

> New missing/unsatisfied dependencies:    service
> jboss.jdbc-driver.sqljdbc (missing)
Run Code Online (Sandbox Code Playgroud)

任何人都知道我做错了什么或我错过了什么?

jboss datasource sqljdbc jboss7.x

15
推荐指数
3
解决办法
3万
查看次数

尝试在数据库重新启动后重新连接jdbc池数据源

我有一个带有Java后端的Web应用程序,它使用Tomcat jdbc-pool进行数据库连接.这很好用.

但是我在将其导出到其他位置之前尝试万无一失,最近出现了有人重新启动SQL Server数据库服务但没有重新启动Tomcat服务的情况.这导致了一个SQLException:java.sql.SQLException: I/O Error: Connection reset by peer: socket write error直到我重新启动Tomcat,强制jdbc-pool数据源重新连接.

我在Tomcat jdbc-pool文档中寻找某种配置来告诉数据源尝试重新连接但我找不到任何东西.

有没有人知道是否有某种配置,或者我应该在每次请求之前检查这种情况吗?

java tomcat datasource jdbc-pool

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

spring boot autoconfiguration with jdbc template autowiring dataSource issue

我是Spring和J2EE的新手.我在使用带有Spring Boot自动配置的JDBC模板时遇到了麻烦.

我做的是我采用这里提供的RESTful Web服务的例子, 并决定扩展它以使用JDBC模板关系数据库访问.不幸的是,提供的另一个例子没有用,因为不考虑从xml beans文件提供dataSource的唯一困难.

我试图解决这个问题:

  1. 使用DAO Impl类作为Spring的不同实现的扩展.
  2. 添加到bean文件.
  3. 使用不同的DataSource类(例如DriverManagerDataSource).
  4. 试图在另一个类中自动装配一个简单的属性(比数据源更复杂的东西).
  5. 在开始时我刚刚编写了DAO类,但是后来我可能只有在实现了接口时才可以自动装配数据源,尝试它,没有帮助.

我尝试了在Stack或Google上找到的所有内容.大多数示例都严重过时或未得到答复,或与Spring Boot Autoconfiguration等无关.

我不断得到Property 'dataSource' is required错误,经过努力,如果最终设法将application-config.xml文件与bean 链接,但无法设法为JDBC的数据源自动装配.

我绝望地完成它并严重阻止,出于想法,如果有人可以提供最新的示例与Spring Boot自动配置,XML中的bean查找,JDBC的自动装配数据源,我会很高兴.

或者至少是一些想法,线索,甚至是如何寻找它,因为我甚至没有谷歌的关键词.

谢谢!

在此输入图像描述

Spring Application类.

package ws;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

@Configuration
@ComponentScan
@ImportResource("classpath:spring/application-config.xml")
@EnableAutoConfiguration
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
Run Code Online (Sandbox Code Playgroud)

Web服务类.

package ws;

import dao.UserDAOImpl;
import model.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public …
Run Code Online (Sandbox Code Playgroud)

spring datasource jdbc autowired spring-boot

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

Xcode 7 storyboard委托数据源场景

更新Xcode 7后,我的一些viewcontrollers名称改为Delegate Scene,该怎么办?谢谢! 在此输入图像描述

更改标题无济于事 在此输入图像描述

xcode delegates datasource storyboard ios

15
推荐指数
2
解决办法
2172
查看次数

加载Mat-table时添加微调器?

我在我的材质表中加载数据:

ngOnInit(){ return this.annuairesService.getMedecins().subscribe(res => this.dataSource.data = res);}
Run Code Online (Sandbox Code Playgroud)

我想在加载时显示微调器: <mat-spinner ></mat-spinner>

我试试:showSpinner:boolean = true;

ngOnInit(){ return this.annuairesService.getMedecins()
.subscribe(res => this.dataSource.data = res);
this.dataSource.subscribe(() => this.showSpinner = false }  
Run Code Online (Sandbox Code Playgroud)

但我有这个错误:

src/app/med-list/med-list.component.ts(54,21): error TS2339: Property 'subscribe' does not exist on type 'MatTableDataSource<{}>'.
Run Code Online (Sandbox Code Playgroud)

datasource spinner typescript angular

15
推荐指数
2
解决办法
2万
查看次数

如何在apache BasicDataSource中使用加密密码?

目前我将密码[未加密]保存在属性文件中.此密码使用ant放置在配置xml中.
[配置xml用于数据源,它正在创建dbcp.BasicDataSource的对象]

现在,是否有可能在ant目标之后以加密形式复制密码.听说Jasypt能做到这一点!直到现在我还没试过这个.但是,问题并没有在这里结束.BasicDataSource不接受加密密码.是否有BasicDatasource的替代品.

仅供参考:我正在使用Spring,如果这很重要的话.

java apache ant encryption datasource

14
推荐指数
2
解决办法
2万
查看次数

如何在Spring中通过XML定义MySql数据源bean

我查看了文档来定义bean.我只是不清楚用于Mysql数据库的类文件.任何人都可以填写下面的bean定义吗?

<bean name="dataSource" class="">
    <property name="driverClassName" value="" />
    <property name="url" value="mysql://localhost/GameManager" />
    <property name="username" value="gamemanagertest" />
    <property name="password" value="1" />
</bean>
Run Code Online (Sandbox Code Playgroud)

spring datasource definition javabeans

14
推荐指数
3
解决办法
8万
查看次数

如何将DataSource转换为List <T>?

我有以下方法在DataGridView上加载产品

private void LoadProducts(List<Product> products)
{
    Source.DataSource = products;  // Source is BindingSource
    ProductsDataGrid.DataSource = Source;
}
Run Code Online (Sandbox Code Playgroud)

现在我试图让我回来保存它们如下图所示.

private void SaveAll()
{
   Repository repository = Repository.Instance;
   List<object> products = (List<object>)Source.DataSource; 
   Console.WriteLine("Este es el número {0}", products.Count);
   repository.SaveAll<Product>(products);
   notificacionLbl.Visible = false;
}
Run Code Online (Sandbox Code Playgroud)

但是我得到了InvalidCastException这条线:

List<object> products = (List<object>)Source.DataSource;
Run Code Online (Sandbox Code Playgroud)

那么如何将DataSource转换为List呢?

c# casting datasource datagridview winforms

14
推荐指数
2
解决办法
3万
查看次数

防止tomcat 7在我的webapp的每次覆盖/取消部署时删除我的自定义上下文文件

我在tomcat 7上部署了一个Web应用程序.它的上下文文件名为myAppName.xml位于 $CATALINA_HOME/conf/Catalina/localhost folder.

我面临的问题是每次覆盖或取消部署时,我的配置文件都从$CATALINA_HOME/conf/Catalina/localhost文件夹中删除,我必须复制/粘贴它从备份位置.

我该如何防止这种行为?每次我在webapp中更改内容时,我都不想复制/粘贴上下文文件.

java deployment datasource tomcat7

14
推荐指数
1
解决办法
3075
查看次数