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
}
Ïà¹ØÎĵµ£º
ÓÐʱºòÎÒÃÇ»áÓöµ½java³ÌÐòʹÓÃÄÚ´æ¹ý¶àµÄÇé¿ö£¬ÕâÖÖÇé¿öÒ»°ãÊÇÒòΪ³ÌÐòÓÐÄÚ´æй©£¬ÄÇôÈçºÎ·ÖÎöÊÇ·ñÓÐÄÚ´æй©ÄØ£¿ÆäʵÔÒò±È½Ï¼òµ¥£¬ÏÈÓÃjmapÀ´Éú³ÉÒ»¸ö½ø³ÌµÄÄÚ´æ¿ìÕÕ£¬È»ºóÀûÓÃheapAnalyzer»òÕßMod4JÀ´¶ÔÕâ¸ö¿ìÕÕ½øÐзÖÎö£¬ÕÒµ½ÄÚ´æʹÓÃ×î¶àµÄ¶ÔÏó¡£ÆäʵÓÐÎÞÄÚ´æй©µÄÒ»¸ö±íÏÖ¾ÍÊÇÄÚ´æ·Ö²¼ÊÇ·ñ¾ùÔÈ£¬Èç¹û²»¾ùÔÈ£¬Ò»°ãÀ ......
Ö±½Óͨ¹ý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) { ......
import java.util.ArrayList;
import java.util.List;
public class FenYe
{
static double allpage=0; //×ÜÒ³Êý
static double currpage=0; //µ±Ç°Ò³
static double pagesize=10; //ÏÔʾÐÐ
static int sta ......
ÎÊÌ⣺ÔÚ´æ´¢¹ý³ÌÖУ¬ÓÐʱ»áÓöµ½±È½Ï±ä̬µÄ¶«Î÷£¬ÈçÒ»¸ö´æ´¢¹ý³ÌÖÐÓÐoutput·µ»ØÖµ£¬ÓÐreturn·µ»ØÖµ£¬»¹ÓвéѯµÄ·µ»ØÖµTABLE£¬Óöµ½ÕâÑùµÄ´æ´¢¹ý³ÌÕæÊÇÓôÃÆ£¬Ò»´ÎÐÔ°ÑËùÓеķµ»Øֵȡ³öÀ´»¹ÕæµÄÓеãÂé·³¡£
1¡¢ Ê×ÏÈÀ´¿´Õâ¸ö´æ´¢¹ý³Ì°É
CREATE PROCEDURE ParaTest
@paraout varchar(20) ......