我在这里有一个表格视图,并希望在用户点击导航控制器中的"后退"按钮时更新UI.我怎样才能做到这一点?
我正在做与TPC-H相关的事情。
我在几个文件中都有sql语句。我需要执行它们并记录执行时间,如下所示:
13 rows in set (0.00 sec)
Run Code Online (Sandbox Code Playgroud)
我还需要结果集以查看是否获得正确的结果。
我的平台是linux(centOS)。
如果我手动执行此操作,则将在mysql中键入如下语句:
shell> mysql -u tpch -p
mysql> use tpch;
mysql> source /home/liova/download/tpch/queries/Q1.sql;
mysql> source /home/liova/download/tpch/queries/Q2.sql;
Run Code Online (Sandbox Code Playgroud) NSFileManager* fileManager = [NSFileManager defaultManager];
NSURL* url = [[fileManager URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask] lastObject];
NSLog(@"%@",url);
NSString* directory = [url absoluteString];
NSLog(@"%@",directory);
if (![fileManager fileExistsAtPath:directory]) NSLog(@"error!!!");
Run Code Online (Sandbox Code Playgroud)
这是上面代码生成的日志:
2012-04-03 15:45:02.298 TopPlaces[805:13303] file://localhost/Users/yzyoyosir/Library/Application%20Support/iPhone%20Simulator/5.0/Applications/2D6EC144-CF85-4994-8904-8FF5F8407FED/Library/Caches/
2012-04-03 15:45:02.300 TopPlaces[805:13303] file://localhost/Users/yzyoyosir/Library/Application%20Support/iPhone%20Simulator/5.0/Applications/2D6EC144-CF85-4994-8904-8FF5F8407FED/Library/Caches/
2012-04-03 15:45:02.301 TopPlaces[805:13303] error!!!
Run Code Online (Sandbox Code Playgroud)
为什么我在这里收到错误.我的意思是为什么目录不存在?
我的IDE是Eclipse Indigo.当我尝试连接时,我得到了这个:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Run Code Online (Sandbox Code Playgroud)
这是我的代码.
public class TPCH
{
public static void main(String[] args)
{
String userName = "tpch";
String password = "tpch";
Connection conn = null;
Properties connectionProps = new Properties();
connectionProps.put("user", userName);
connectionProps.put("password", password);
try
{
Class.forName("com.mysql.jdbc.Driver");
}
catch (Exception e)
{
e.printStackTrace();
}
try {
conn = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/",
connectionProps);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
System.out.println("Error connecting to db");
}
}
}
Run Code Online (Sandbox Code Playgroud)
我认为JDBC不是导入的.我尝试导入它
preference -> java -> build path -> user …Run Code Online (Sandbox Code Playgroud)