Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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¼ÓÃÜÓë½âÃÜ£¨Ò»£©

jdk°²È«Ç¿¶ÈÉèÖãº
   http://java.sun.com/javase/downloads/index.jspÖеÄOther DownloadsÏÂÔØ 
   ½âѹzip,
   ÓÃÆäÖеÄÁ½¸öjar°ü¸²¸Çjdk6ÏÂ\%JDK_HOME%\jre\lib\securityĿ¼ÏµÄjar°ü
   jreĿ¼ÏÂÒ²×÷ÏàͬÅäÖÃ
   È»ºóͨ¹ý´úÂë¶Î
try {
  & ......

JAVA¶¨Ê±Æ÷ÀàµÄʹÓÃ


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++ÓëJava¶àάÊý×飬±éÀúÓë×î´óÖµ»ñÈ¡·½·¨£¡

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 ......

java»ñµÃÏîĿ·¾¶

    /**
  * »ñÈ¡·þÎñÆ÷µÄwebµØÖ·
  * @return
  */
 private String getWebPath(){ 
  
   String _tempStr = Thread.currentThread().getContextClassLoader().getResource("").toString();
  
   _tempStr=_tempStr.substring ......

Java½Ó¿Ú,³éÏóÀ࣬ÄÚ²¿Àà

×î½ü¿´µ½µÄһƪÎÄÕ£¬¾õµÃдµÄͦºÃ£¬¾Íת¹ýÀ´ÒÔ±ã×Ô¼ºÀ´¿´¡£
¿´µ½ÂÛ̳ÀïÓиöÌû×ÓÔÚÌÖÂ۽ӿںͳéÏóÀàµÄÇø±ðºÍ×÷Óã¬ÕâÆäʵҲÊǺܶàÃæÊÔ¹Ùϲ»¶ÎʵÄÎÊÌ⣬ÕâÀïÎÒ¾Í˵˵ÎÒµÄ×ܽᣬ˳±ã˵˵ÄÚ²¿ÀàµÄ×÷Ó㬵±ÊǸø¸ÕÈëÃÅ£¬»òÕßÏëѧϰjavaµÄͬѧÃÇÄܸüºÃµÄÀí½âËüÃǵÄÓ÷¨¡£
1.½Ó¿Ú(interface)£¬½Ó¿Ú±»ÓÃÀ´½¨Á¢ÀàÓëÀàÖ®¼ä¹ØÁªµÄ±ê× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ