javaÊý¾Ý¿âÁ¬½Ó¼°²âÊÔ(sqlserver)
package com.test.util;
import java.sql.*;
public class ConnectDB {
private Connection conn=null;
private PreparedStatement pt=null;
private ResultSet rs=null;
private String uname="sa";
private String upwd="sa";
private String url="jdbc:microsoft:sqlserver://localhost:1433;databaseName=vsktest";
public Connection getConnection() throws Exception{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
conn=DriverManager.getConnection(url, uname, upwd);
return conn;
}
public void closeDB() throws Exception{
if(rs!=null){
rs.close();
}
if(pt!=null){
pt.close();
}
if(conn!=null){
conn.close();
}
}
public static void main(String[] args) throws Exception {
Connection conn=new ConnectDB().getConnection();
PreparedStatement pt=conn.prepareStatement("select * from test");
ResultSet rs=pt.executeQuery();
while(rs.next())
{
System.out.println(rs.getString("testname"));
}
}//end main
}
Ïà¹ØÎĵµ£º
Ö±½Óͨ¹ýmainÈë¿Ú:
argumentsÉèÖãº-Djava.library.path=¶¯Ì¬¿âËùÔÚĿ¼
ÔÚLinuxÉϵ÷.soÎļþ£º.soÎļþ ±ØÐëÃüÃûΪ£ºlibXXX.so,È磺libJni.so
ÔÚWindowsÉϵ÷.dllÎļþ£º.dllÎļþ ÃüÃû²»Òª¼Ólib,Ö±½ÓÃüÃûΪ£ºXXX.dll È磺Jni.dll
Àý£º
¶¯Ì¬¿â£ºlibJniNassirDecrypt.so »ò JniNassirDecrypt.dll
javaµ÷Óö¯Ì¬¿â´úÂë:
Str ......
Java´úÂë
import java.util.Timer;
import java.util.TimerTask;
import java.util.Timer;
import java.util.TimerTask;
Java´úÂë
public class Test {
public static void main(String[] args) { ......
C/C++
/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê4ÔÂ29ÈÕ, ÉÏÎç9:46
*/
#include <iostream>
using namespace std;
int maximum(int[], int);
int main(int argc, char** argv) {
// int sg[3][4] = {
int sg[][4] = {
{68, 77, 73, 86},
{87, 96, 7 ......
jspÊä³ö¸ñʽ»¯ºóµÄÈÕÆÚ
<fmt:formatDate value="${whiteNumber.crtdate }" pattern="yyyy-MM-dd HH:mm:ss"/>
ÈçÊÇmodelÀïµÄlistÔÚactionÖÐÈ¡²»µ½Öµ¡£¿ÉÄÜÔÚ¸ÃmodelÖеÄlistµÄsetterºÍgetter·½Ê½ÖУ¬Ê¹ÓõĿÉÄÜÊÇlazy¼ÓÔØ£¬¸ÄΪEAGER¼´¿É¡£
<s:iterator>±êÇ©ÀﻹÓÐ<s:iterator>± ......