亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? osqldlg.cpp

?? VC下通過Oracle OCI方式連接數(shù)據(jù)庫。
?? CPP
字號:
// OsqlDlg.cpp : implementation file
//
// Release 1, Copyright (C) 1999 Ben Bryant
// This is sample source code, nothing more is implied. Use it only as such.
// This software is provided 'as-is', without warranty. In no event will the
// author be held liable for any damages arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose.
// The origin of this software must not be misrepresented; you must not claim
// that you wrote the original software. Altered source versions must be plainly
// marked as such, and must not be misrepresented as being the original software.
// Ben Bryant bcbryant@firstobject.com
//

#include "stdafx.h"
#include "Osql.h"
#include "OsqlDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// COsqlDlg dialog

COsqlDlg::COsqlDlg(CWnd* pParent /*=NULL*/)
	: CDialog(COsqlDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(COsqlDlg)
	//}}AFX_DATA_INIT
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
	m_csTitle = "Osql 1.0";
}

void COsqlDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(COsqlDlg)
	DDX_Control(pDX, IDC_EDIT_OUTPUT, m_cmdOutput);
	DDX_Control(pDX, IDC_EDIT_COMMAND, m_cmdInput);
	DDX_Control(pDX, IDC_BUTTON_DO, m_buttonDo);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(COsqlDlg, CDialog)
	//{{AFX_MSG_MAP(COsqlDlg)
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(IDC_BUTTON_DO, OnButtonDo)
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COsqlDlg message handlers

BOOL COsqlDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	// Set dialog title
	SetWindowText( m_csTitle );

	// Initialize command controls
	m_cmd.Init( this, &m_cmdOutput, &m_cmdInput, &m_buttonDo );

	// Initial resize
	CRect rect;
	GetClientRect( &rect );
	CalcSize( rect.Width(), rect.Height() );

	// Startup intro
	About();

	return TRUE;  // return TRUE  unless you set the focus to a control
}

void COsqlDlg::About()
{
	Output( m_csTitle, CCmdOutCtrl::Large );
	m_cmdOutput.SetFontFace( "Arial" );
	Output( "Osql is a command line graphical user interface that helps you "
		"use PL/SQL to access Oracle databases. The source code features my COdb "
		"class which is a simple C++ wrapper for the Oracle Call Interface (OCI). "
		"Osql connects to databases through SQL*Net 8.0. The OCI, SQL*Net, SQL*Plus, "
		"and the PL/SQL extension of SQL are products of Oracle Corporation. "
		"The Osql program is provided 'as-is', without warranty. In no event will "
		"the author be held liable for any damages arising from the use of this "
		"software."
		);
	Output( "Copyright (C) 1999 Ben Bryant", CCmdOutCtrl::Bold );
	Output( "bcbryant@firstobject.com" );
	Output( "First Objective Software, Inc." );
	Output( "www.firstobject.com" );
	m_cmdOutput.SetFontFace();
}

void COsqlDlg::Help()
{
	ShowWindow( SW_MAXIMIZE );
	m_cmdOutput.SetFontFace( "Arial" );
	Output(
		"You can immediately connect to an Oracle database, select from "
		"tables and execute SQL statements, much as you would in SQL*Plus "
		"without the semi-colons. As in SQL*Plus, there are also some non-SQL "
		"commands. Type a question mark to see a list of the commands available "
		"in Osql. Each command is listed with its named arguments and defaults "
		"if any. Only use semi-colons where they are required in PL/SQL blocks. "
		"If you enter something that does not start with any of these Osql "
		"commands, Osql tries to execute it as an SQL statement."
		);
	Output(
		"The interface for re-using and modifying chunks of commands and pl/sql "
		"blocks is handy. If you right click in the output area you can copy text "
		"to the command entry box or immediately run it. The command entry box "
		"resizes to fit multiple lines of text when you paste in a large pl/sql "
		"block or use ctrl-enter to start a new line. The escape key exits the "
		"program (closing the session if open). The first command you will need "
		"is the connect command. It works like SQL*Plus 8.0 and uses your Net80 "
		"configuration to connect to the Oracle database. No host name is "
		"necessary if the database is on the same machine."
		);
	m_cmdOutput.SetFontFace( "Courier New" );
	Output( "connect scott/tiger@host" );
	m_cmdOutput.SetFontFace( "Arial" );
	Output(
		"One of the differences from SQL*Plus is that semi-colons are not allowed "
		"except after anonymous blocks. This corresponds to what the OCI expects "
		"in an Execute statement. If you have the necessary permissions, you can "
		"try copying and pasting the following commands into Osql, one create "
		"command at a time:"
		);
	m_cmdOutput.SetFontFace( "Courier New" );
	Output( "create table table1 (n NUMBER(22), d date, c VARCHAR2(80) )" );
	Output( "create sequence sequence1" );
	Output(
		"create or replace package package1 is\n"
		"  function add_entry (c in VARCHAR2 ) return NUMBER;\n"
		"end package1;"
		);
	Output(
		"create or replace package body package1 is\n"
		"  function add_entry (c in VARCHAR2 ) return NUMBER is\n"
		"  n NUMBER(22);\n"
		"  begin\n"
		"    select sequence1.nextval into n from dual;\n"
		"    insert into table1 values ( n, sysdate, c );\n"
		"    return n;\n"
		"  end add_entry;\n"
		"end package1;"
		);
	m_cmdOutput.SetFontFace( "Arial" );
	Output(
		"After you have created these objects, you can try them out using the "
		"following commands:"
		);
	m_cmdOutput.SetFontFace( "Courier New" );
	Output( "declare n number(22); begin n := package1.add_entry( 'something' ); end;" );
	Output( "select * from table1" );
	m_cmdOutput.SetFontFace( "Arial" );
	Output( "Have Fun!!!" );
	m_cmdOutput.SetFontFace();
}

void COsqlDlg::CalcSize(int cx, int cy)
{
	// Position controls according to size of dialog within margins
	m_cmd.MoveControls( CRect( 8, 6, cx-7, cy-7 ) );
}

void COsqlDlg::OnSize(UINT nType, int cx, int cy) 
{
	CDialog::OnSize(nType, cx, cy);
	
	// Calculate child window sizes if they exist
	if ( ::IsWindow(m_buttonDo.m_hWnd) )
		CalcSize( cx, cy );
}

void COsqlDlg::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// Draw the icon
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}

HCURSOR COsqlDlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}

void COsqlDlg::OnButtonDo() 
{
	CString csCommand;
	m_cmdInput.GetWindowText( csCommand );
	HRESULT hr = RunCommand( csCommand );
	if ( SUCCEEDED(hr) )
		m_cmdInput.SetCommandText( "" );
	m_cmdInput.SetFocus();
}

HRESULT COsqlDlg::RunCommand( CString csCommandLine ) 
{
	// Array of commands
	// This makes it very easy to add commands with required arguments and defaults
	// Arguments are comma delimited, use the last argument to receive values with commas
	static const char* szaCommandDefns[] =
	{
		// Database commands
		"db.connect connectstring=/#user/password@host",
		"db.disconnect",
		"db.exec sql#explicit execute",
		"db.select sql#select a set of records",

		// Miscellaneous commands
		"misc.about",
		"misc.? command=*",
		"misc.help#instructions for using Osql",
		"misc.max max=1#maximize dialog, specify 0 to restore",

		// Terminator
		""
	};

	// Parse command line
	m_cmd.ParseCommandLine( csCommandLine, szaCommandDefns );
	CString csCommand = m_cmd.GetCommand();
	Output( m_cmd.GetCommandLine(), CCmdOutCtrl::Bold );
	CString csService = m_cmd.GetService();
	CStringArray& csaArgs = *m_cmd.GetArgs();

	// Check command
	if ( csCommand.IsEmpty() )
	{
		// Command not recognized, pretend it was exec
		csCommand = "exec";
		csaArgs.Add( csCommandLine );
		csService = "db";
	}
	else if ( ! m_cmd.GetSyntaxError().IsEmpty() )
	{
		// Syntax error
		Output( m_cmd.GetSyntaxError() );
		csCommand.Empty();
	}

	// Prepare to do command
	CWaitCursor wait;
	HRESULT hr = 0;

	// Non-db commands
	if ( csCommand == "?" )
	{
		m_cmdOutput.OutputHelp( csaArgs[0], szaCommandDefns );
		return 0;
	}
	else if ( csCommand == "max" )
	{
		if ( atoi(csaArgs[0]) )
			ShowWindow( SW_MAXIMIZE );
		else
			ShowWindow( SW_RESTORE );
	}
	else if ( csCommand == "about" )
		About();
	else if ( csCommand == "help" )
		Help();

	// Database
	else if ( csCommand == "connect" )
	{
		m_db.StartLog();
		hr = m_db.Open( csaArgs[0] );
		Output( m_db.GetLog() );
	}
	else if ( csCommand == "disconnect" )
		hr = m_db.Close();
	else if ( csCommand == "exec" )
		hr = m_db.Exec( csaArgs[0] );
	else if ( csCommand == "select" )
	{
		// Set SQL in recordset and run it
		CString csSelect( csaArgs[0] );
		if ( csSelect.GetLength() < 7 || csSelect.Left(7) != "select " )
			csSelect = "select " + csSelect;
		hr = m_db.Select( csSelect );

		// Loop through results
		while ( SUCCEEDED(hr) && ! m_db.IsEOS() )
		{
			Output( m_db.GetResults() );
			m_db.FetchNext();
			hr = 0;
		}
	}

	if ( csService == "db" )
		Output( m_db.GetErrorDescription() );
	return hr;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产首页| 九一九一国产精品| 日韩制服丝袜先锋影音| 久久久精品tv| 久久久久久久久久美女| 国产网站一区二区| 国产女主播视频一区二区| 一区二区三区在线视频免费观看| 亚洲国产精品久久一线不卡| 看电影不卡的网站| 欧美日韩一区二区三区视频 | 久久亚洲一级片| 中文字幕亚洲区| 国产在线观看一区二区| 99热99精品| 正在播放亚洲一区| 国产精品成人一区二区三区夜夜夜 | 九一久久久久久| 91福利国产精品| 久久久亚洲精品一区二区三区 | 2024国产精品| 亚洲高清免费一级二级三级| 成人免费av资源| 日韩区在线观看| 亚洲主播在线观看| 成人午夜私人影院| 精品精品国产高清一毛片一天堂| 亚洲精品乱码久久久久久 | 一区二区成人在线| 国产精品88888| 日韩欧美一区二区不卡| 亚洲美女视频一区| 国产成人免费视频网站| 欧美本精品男人aⅴ天堂| 亚洲国产aⅴ成人精品无吗| caoporn国产一区二区| 国产三级欧美三级日产三级99| 亚洲自拍偷拍综合| 色美美综合视频| 国产精品天天看| 国产精品自产自拍| 精品国产乱码久久久久久闺蜜| 日日夜夜一区二区| 欧美日韩一卡二卡三卡 | 亚洲欧美一区二区三区极速播放| 国产一区二区毛片| www国产精品av| 国产一区二区女| 国产欧美一区二区精品性色超碰| 国产尤物一区二区| 欧美精品一区二区三区一线天视频 | 日本aⅴ亚洲精品中文乱码| 成人性生交大片免费看中文| 欧美午夜一区二区| 久久精品在线免费观看| 蜜臀av性久久久久蜜臀aⅴ四虎| 在线免费观看一区| 中文字幕日韩一区二区| 国产成人自拍网| 久久久综合激的五月天| 激情小说欧美图片| 欧美一区二区三区免费观看视频| 亚洲成人av一区二区三区| 91亚洲精品久久久蜜桃| 国产精品婷婷午夜在线观看| 丁香六月综合激情| 日韩午夜在线观看视频| 日本三级韩国三级欧美三级| 精品视频在线视频| 亚洲一区二区三区不卡国产欧美| 色视频一区二区| 欧美国产乱子伦| 国产精品综合二区| 国产女同互慰高潮91漫画| 国产不卡视频在线观看| 精品日韩欧美在线| 午夜精品一区二区三区电影天堂| 国产jizzjizz一区二区| 欧美精品一区二区三区蜜桃 | 91精品国产综合久久婷婷香蕉| 亚洲成a人在线观看| 在线亚洲一区二区| 亚洲在线视频网站| 91精品国产综合久久久久| 蜜臀99久久精品久久久久久软件| 日韩精品最新网址| 国产福利不卡视频| 国产精品国产三级国产普通话蜜臀 | 波多野结衣欧美| 国产精品久久久久久久久晋中| 成人福利在线看| 一区二区三区av电影| 在线亚洲+欧美+日本专区| 视频一区中文字幕| 欧美成人激情免费网| 国产一区二区精品久久99| 国产欧美日韩另类一区| 日韩免费高清电影| 国产一区二区三区国产| 中文字幕一区二区不卡| 丁香啪啪综合成人亚洲小说 | 99免费精品在线| 午夜精品久久久久久久久久 | 欧美日韩国产精品成人| 麻豆成人久久精品二区三区小说| 久久久久国色av免费看影院| 成人aaaa免费全部观看| 婷婷六月综合网| 国产清纯美女被跳蛋高潮一区二区久久w | 成人激情校园春色| 午夜精品视频一区| 国产欧美日韩激情| 欧美日韩国产在线播放网站| 久久97超碰国产精品超碰| 亚洲免费观看高清| 欧美大白屁股肥臀xxxxxx| 99久久精品国产观看| 日韩精品91亚洲二区在线观看| 国产清纯在线一区二区www| 欧美人伦禁忌dvd放荡欲情| 国产精品影视天天线| 亚洲123区在线观看| 日本一区二区三区在线不卡| 日韩欧美国产精品一区| 色综合天天综合网天天看片| 久久精品国产网站| 亚洲美女屁股眼交3| 久久久久久毛片| 在线不卡a资源高清| 北条麻妃国产九九精品视频| 免费高清不卡av| 国产精品素人一区二区| 精品免费视频.| 91麻豆视频网站| 激情欧美日韩一区二区| 日韩精品色哟哟| 亚洲国产sm捆绑调教视频 | 精品无人区卡一卡二卡三乱码免费卡| 亚洲欧洲日韩一区二区三区| 欧美一二三在线| 欧美午夜精品久久久| 成人在线一区二区三区| 极品少妇xxxx精品少妇| 日韩不卡一区二区三区 | 欧美女孩性生活视频| 91视频在线观看| 99在线视频精品| 波多野结衣亚洲| 99久久99久久精品免费观看| 成人一二三区视频| 国产成人免费9x9x人网站视频| 老司机一区二区| 亚洲午夜精品网| 亚洲自拍与偷拍| 亚洲电影你懂得| 亚洲国产aⅴ天堂久久| 亚洲一区二区免费视频| 艳妇臀荡乳欲伦亚洲一区| 亚洲欧洲精品天堂一级| 国产精品毛片高清在线完整版 | 麻豆中文一区二区| 日本亚洲三级在线| 日韩精品乱码av一区二区| 日韩专区欧美专区| 奇米888四色在线精品| 麻豆精品一区二区综合av| 蜜桃视频一区二区| 国产精一区二区三区| 国产黄色精品视频| 99热这里都是精品| 91电影在线观看| 欧美日韩一级大片网址| 7777精品久久久大香线蕉| 久久精品人人做人人爽人人| 国产日韩三级在线| 中文字幕欧美一| 性做久久久久久久免费看| 日韩成人午夜电影| 国产麻豆精品久久一二三| 丁香婷婷综合色啪| 91丨九色丨蝌蚪富婆spa| 欧美丝袜自拍制服另类| 欧美日高清视频| 91精品国产乱| 久久久国产精品麻豆| 久久久久久99精品| 成人欧美一区二区三区小说| 亚洲一区二区精品久久av| 亚洲第一成人在线| 中国av一区二区三区| 夜夜揉揉日日人人青青一国产精品| 亚洲一区二区在线播放相泽| 免费在线看一区| 成人丝袜视频网| 欧美久久久久久久久中文字幕| 精品久久一区二区| 国产精品区一区二区三区 | 91传媒视频在线播放| 日韩你懂的电影在线观看| 国产精品伦一区|