Java³ÌÐòµ÷Óô洢¹ý³ÌÓ¦ÓþÙÀý
Java³ÌÐòµ÷Óô洢¹ý³ÌÑéÖ¤Óû§µÇ¼
package com.yzy.jdbc.dao;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import oracle.jdbc.OracleTypes;
public class LoginDao {
public boolean loginValidate(String username, String password) {
boolean isValid = false;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@127.0.0.1:1521:orcl";
Connection conn = DriverManager.getConnection(url, "scott", "yzy");
CallableStatement cstmt = null;
ResultSet rs = null;
String sql = "{ call p_validate(?,?,?) }";
cstmt = conn.prepareCall(sql);
cstmt.setString(1, username);
cstmt.setString(2, password);
cstmt.registerOutParameter(3, OracleTypes.NUMBER);
cstmt.execute();
long num = cstmt.getLong(3);
if (num > 0) {
isValid = true;
}
} catch (Exception e) {
e.printStackTrace();
}
return isValid;
}
}
Java³ÌÐòµ÷Óô洢¹ý³Ì²éѯ²¢·µ»Ø½á¹û¼¯
package com.yzy.jdbc.dao;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import oracle.jdbc.OracleTypes;
public class Demo2Dao {
public void query() {
boolean isValid = false;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@127.0.0.1:1521:orcl";
Connection conn = DriverManager.getConnection(url, "scott", "yzy");
CallableStatement cstmt = null;
ResultSet rs = null;
String sql = "{ call pack_res.p_g
Ïà¹ØÎĵµ£º
ͻ񻣼
±¾ÎÄÕë¶Ôjava³õѧÕß»òÕßannotation³õ´ÎʹÓÃÕßÈ«ÃæµØ˵Ã÷ÁËannotationµÄʹÓ÷½·¨¡¢¶¨Ò巽ʽ¡¢·ÖÀà¡£³õѧÕß¿ÉÒÔͨ¹ýÒÔÉϵÄ˵Ã÷ÖÆ×÷¼òµ¥µÄannotation³ÌÐò£¬µ«ÊǶÔÓÚһЩ¸ß¼¶µÄannotationÓ¦Óã¨ÀýÈçʹÓÃ×Ô¶¨ÒåannotationÉú³ÉjavabeanÓ³ÉäxmlÎļþ£©»¹ÐèÒª½øÒ»²½µÄÑо¿ºÍ̽ÌÖ¡£Éæ¼°µ½ÉîÈëannotationµÄÄÚÈÝ£¬×÷Õß½«ÔÚºóÎÄ¡ ......
OracleÖпÉÒÔµ÷ÓÃJavaµÄ´úÂ룬һ°ãͨ¹ýÁ½ÖÖ·½Ê½½øÐе÷Óã¬Ò»¸öÊÇÖ±½Ó½«Java´úÂëдÔÚOracleÄÚ²¿£¬ÁíÍâÒ»ÖÖÊǽ«±àÒëºÃµÄclassÎļþÔØÈëµ½OracleÖС£
-A-
1¡¢ÔÚSQLPlusÖд´½¨OracleÖеÄJavaÀàÓë·½·¨£¨·½·¨±ØÐëÊǾ²Ì¬¹«Óз½·¨£©
create or replace and compile java source named hello as
public class Hello {
pu ......
import java.awt.Image;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import javax.imageio.ImageIO;
public class createXml
{
public static boolean writeXml(String path,String dir,String wpath,String wname)
{
File[] files = ReaderListFiles(path);
boo ......
Java json lib
¸ù¾Ýhttp://www.javaeye.com/topic/561368̸µ½µÄÒ»¸öjacksonµÄjsonÐòÁл¯¹¤¾ßÐÔÄܱÈjson-libµÈÒªºÃ
ÎÞÂÛÊÇÔڵͲ¢·¢»¹ÊǸ߲¢·¢µÄÇé¿öÏ£¬Ê±¼äÐÔÄÜÉÏ£¬jacksonʹÓÃÖØÓÃObjectMapper·½Ê½´ó´óÓÅÓÚʹÓÃjson-lib·½Ê½£¬ÉõÓÚjacksonʹÓ÷ÇÖØÓÃObjectMapper·½Ê½Ò²ÂÔÓÅÓÚjson-lib·½Ê½¡£ÁíÍâÒ²¿ÉÒÔ¿´³ö£¬jacksonÔÚÖØÓà ......
java»·¾³Ïµ÷ÓÃVC++±àдµÄ¶¯Ì¬Á´½Ó¿âÎļþ
Ò»£¬¿ª·¢Æ½Ì¨£º
MyEclipse 6.0£¬VC++6.0
¶þ£¬JNI»ù´¡ÖªÊ¶£º
JNI(java native interface)£¬JAVA±¾µØ½Ó¿Úµ÷Óã¬Ä¿µÄÊÇΪÁËJAVA¿ÉÒÔµ÷Óñ¾µØ³ÌÐò¡£
Èý£¬½»»¥¹ý³Ì£º
1£¬½¨Á¢javaÀà¡£ÀýÈ磬½¨Á¢Ò»¸öRSA¼ÓÃܽâÃܵÄÀࣺ
package zkxx.ctais2.client.common;
public class RsaE ......