国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

在 Ubuntu 使用SQL Server創(chuàng)建 Go 應用程序

這篇具有很好參考價值的文章主要介紹了在 Ubuntu 使用SQL Server創(chuàng)建 Go 應用程序。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

一、設置環(huán)境

在 Ubuntu 機器上安裝 SQL Server 2017和安裝運行 GoLang 所需的依賴項。

1.1、安裝 SQL Server

為了確保 SQL Server 的最佳性能,計算機應至少具有 4 GB 的內(nèi)存。
在 Ubuntu 使用SQL Server創(chuàng)建 Go 應用程序

(1)注冊 Microsoft Linux 存儲庫并添加其密鑰。

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list | sudo tee /etc/apt/sources.list.d/mssql-server-2017.list

(2)安裝 SQL Server。

sudo apt-get update
sudo apt-get install mssql-server

執(zhí)行結果:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  mssql-server
...
Unpacking mssql-server ...
Setting up mssql-server ...

(3)設置 SQL Server。

sudo /opt/mssql/bin/mssql-conf setup

執(zhí)行結果:

Microsoft(R) SQL Server(R) Setup

To abort setup at anytime, press Ctrl-C.

The license terms for this product can be downloaded from http://go.microsoft.com/fwlink/?LinkId=746388 and
found in /usr/share/doc/mssql-server/LICENSE.TXT.

Do you accept the license terms? If so, please type YES:
Please enter a password for the system administrator (SA) account:
Please confirm the password for the system administrator (SA) account:

1.2、安裝 GoLang

如果您的機器上已經(jīng)安裝了 Go,請?zhí)^此步驟。

(1)下載安裝。

curl -O https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
tar xvf go1.8.linux-amd64.tar.gz
sudo chown -R root:root ./go
sudo mv go /usr/local

(2)將這兩行添加到 ~/.profile 文件中。

export GOPATH=$HOME/work
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

1.3、安裝 ODBC 驅(qū)動程序和 SQL 命令行實用工具 SQL 服務器

SQLCMD 是一個命令行工具,能夠連接到 SQL Server 并運行查詢。

(1)下載適用于操作系統(tǒng)版本的軟件包。

sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -

#Download appropriate package for the OS version
#Choose only ONE of the following, corresponding to your OS version

#Ubuntu 16.04
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list

#Ubuntu 18.04
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list

#Ubuntu 19.10
curl https://packages.microsoft.com/config/ubuntu/19.10/prod.list > /etc/apt/sources.list.d/mssql-release.list

exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install mssql-tools
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install unixodbc-dev

(2)安裝 SQLCMD 后,可以使用以下命令連接到 SQL Server:

sqlcmd -S localhost -U sa -P yourpassword
1> # You're connected! Type your T-SQL statements here. Use the keyword 'GO' to execute each batch of statements.

(3)測試數(shù)據(jù)庫。結果將打印到標準輸出。

sqlcmd -S localhost -U sa -P yourpassword -Q "SELECT @@VERSION"

--------------------------------------------------------
Microsoft SQL Server vNext (CTP2.0) - 14.0.500.272 (X64)
	Apr 2 2023 11:44:40
	Copyright (c) Microsoft Corporation
    on Linux (Ubuntu 16.04)

1 rows(s) returned

Executed in 1 ns

至此,已成功在 Ubuntu 機器上安裝 SQL Server 命令行實用程序,已經(jīng)在 Ubuntu 計算機上成功安裝并設置 GoLang 和 mssql-tools?,F(xiàn)在擁有開始使用 SQL Server 編寫 Go 應用程序所需的一切。

二、使用 SQL 服務器創(chuàng)建 Go 應用程序

安裝 SQL Server 和 GoLang 后,現(xiàn)在可以繼續(xù)創(chuàng)建新的 Go 項目。在這里,將探討三個簡單的應用程序。其中一個將連接并打印數(shù)據(jù)庫服務器的SQL Server版本,另一個將執(zhí)行基本的插入,更新,刪除和選擇操作,第三個將使用GORM,一種流行的對象關系映射(ORM)框架,用于Go執(zhí)行相同的操作。

2.1、創(chuàng)建連接到 SQL Server 并執(zhí)行查詢的 Go 應用

(1)創(chuàng)建新的項目目錄并安裝 Go 依賴項。

cd ~/

#Create Project Directory
mkdir SqlServerSample
cd SqlServerSample

# Get and install the SQL Server driver for Go
go get github.com/denisenkom/go-mssqldb
go install github.com/denisenkom/go-mssqldb

(2)通過使用 sqlcmd 連接到 SQL Server 并執(zhí)行以下命令,創(chuàng)建將用于本教程其余部分的數(shù)據(jù)庫。不要忘記使用自己的用戶名和密碼更新用戶名和密碼。

sqlcmd -S 127.0.0.1 -U sa -P <你的> -Q "CREATE DATABASE SampleDB;"

(3)創(chuàng)建一個連接到 SQL Server 的簡單 Go 應用。
在 SqlServerSample 文件夾中創(chuàng)建一個名為 connect.go 的文件。將以下內(nèi)容復制并粘貼到文件中。不要忘記使用自己的用戶名和密碼更新用戶名和密碼。
此示例使用 GoLang 上下文方法來確保存在與數(shù)據(jù)庫服務器的活動連接。

package main

import (
    _ "github.com/denisenkom/go-mssqldb"
    "database/sql"
    "context"
    "log"
    "fmt"
)

// Replace with your own connection parameters
var server = "localhost"
var port = 1433
var user = "sa"
var password = "xxxxxx"

var db *sql.DB

func main() {
    var err error

    // Create connection string
    connString := fmt.Sprintf("server=%s;user id=%s;password=%s;port=%d",
        server, user, password, port)

    // Create connection pool
    db, err = sql.Open("sqlserver", connString)
    if err != nil {
        log.Fatal("Error creating connection pool: " + err.Error())
    }
    log.Printf("Connected!\n")

    // Close the database connection pool after program executes
    defer db.Close()

    SelectVersion()
}

// Gets and prints SQL Server version
func SelectVersion(){
    // Use background context
    ctx := context.Background()

    // Ping database to see if it's still alive.
    // Important for handling network issues and long queries.
    err := db.PingContext(ctx)
    if err != nil {
        log.Fatal("Error pinging database: " + err.Error())
    }

    var result string

    // Run query and scan for result
    err = db.QueryRowContext(ctx, "SELECT @@version").Scan(&result)
    if err != nil {
        log.Fatal("Scan failed:", err.Error())
    }
    fmt.Printf("%s\n", result)
}

(4)運行應用程序。

go run connect.go

執(zhí)行結果:

Connected!
Microsoft SQL Server 2017 (CTP2.1) - 14.0.600.250 (X64)
        Apr 2 2017 12:21:23
        Copyright (C) 2017 Microsoft Corporation. All rights reserved.
        Developer Edition (64-bit) on Linux (Ubuntu 16.04.2 LTS)

(5)在 SqlServerSample 文件夾中創(chuàng)建一個名為 CreateTestData 的文件.sql。將以下 T-SQL 代碼復制并粘貼到其中。這將創(chuàng)建一個架構、表并插入幾行。

CREATE SCHEMA TestSchema;
GO

CREATE TABLE TestSchema.Employees (
  Id INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
  Name NVARCHAR(50),
  Location NVARCHAR(50)
);
GO

INSERT INTO TestSchema.Employees (Name, Location) VALUES
(N'Jared', N'Australia'),
(N'Nikita', N'India'),
(N'Tom', N'Germany');
GO

SELECT * FROM TestSchema.Employees;
GO

(6)使用 sqlcmd 連接到數(shù)據(jù)庫并運行 SQL 腳本以創(chuàng)建架構、表并插入一些行。

sqlcmd -S 127.0.0.1 -U sa -P <你的> -d SampleDB -i ./CreateTestData.sql

執(zhí)行結果:

CREATE SCHEMA TestSchema;

Executed in 0 ms
CREATE TABLE TestSchema.Employees (
  Id INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
  Name NVARCHAR(50),
  Location NVARCHAR(50)
);

Executed in 0 ms
INSERT INTO TestSchema.Employees (Name, Location) VALUES
(N'Jared', N'Australia'),
(N'Nikita', N'India'),
(N'Tom', N'Germany');

Executed in 0 ms
SELECT * FROM TestSchema.Employees;
Id  Name    Location
--  ------  ---------
1   Jared   Australia
2   Nikita  India
3   Tom     Germany

3 row(s) returned

Executed in 1 ms

(7)在 SqlServerSample 文件夾中創(chuàng)建一個名為 crud.go 的新文件。將以下代碼復制并粘貼到其中。這將插入、更新、刪除和讀取幾行。

package main

import (
    _ "github.com/denisenkom/go-mssqldb"
    "database/sql"
    "context"
    "log"
    "fmt"
    "errors"
)

var db *sql.DB

var server = "localhost"
var port = 1433
var user = "sa"
var password = "你的"
var database = "SampleDB"

func main() {
    // Build connection string
    connString := fmt.Sprintf("server=%s;user id=%s;password=%s;port=%d;database=%s;",
        server, user, password, port, database)

    var err error

    // Create connection pool
    db, err = sql.Open("sqlserver", connString)
    if err != nil {
        log.Fatal("Error creating connection pool: ", err.Error())
    }
    ctx := context.Background()
    err = db.PingContext(ctx)
    if err != nil {
        log.Fatal(err.Error())
    }
    fmt.Printf("Connected!\n")

    // Create employee
    createID, err := CreateEmployee("Jake", "United States")
    if err != nil {
        log.Fatal("Error creating Employee: ", err.Error())
    }
    fmt.Printf("Inserted ID: %d successfully.\n", createID)

    // Read employees
    count, err := ReadEmployees()
    if err != nil {
        log.Fatal("Error reading Employees: ", err.Error())
    }
    fmt.Printf("Read %d row(s) successfully.\n", count)

    // Update from database
    updatedRows, err := UpdateEmployee("Jake", "Poland")
    if err != nil {
        log.Fatal("Error updating Employee: ", err.Error())
    }
    fmt.Printf("Updated %d row(s) successfully.\n", updatedRows)

    // Delete from database
    deletedRows, err := DeleteEmployee("Jake")
    if err != nil {
        log.Fatal("Error deleting Employee: ", err.Error())
    }
    fmt.Printf("Deleted %d row(s) successfully.\n", deletedRows)
}

// CreateEmployee inserts an employee record
func CreateEmployee(name string, location string) (int64, error) {
    ctx := context.Background()
    var err error

    if db == nil {
        err = errors.New("CreateEmployee: db is null")
        return -1, err
    }

    // Check if database is alive.
    err = db.PingContext(ctx)
    if err != nil {
        return -1, err
    }

    tsql := "INSERT INTO TestSchema.Employees (Name, Location) VALUES (@Name, @Location); select convert(bigint, SCOPE_IDENTITY());"

    stmt, err := db.Prepare(tsql)
    if err != nil {
        return -1, err
    }
    defer stmt.Close()

    row := stmt.QueryRowContext(
        ctx,
        sql.Named("Name", name),
        sql.Named("Location", location))
    var newID int64
    err = row.Scan(&newID)
    if err != nil {
        return -1, err
    }

    return newID, nil
}

// ReadEmployees reads all employee records
func ReadEmployees() (int, error) {
    ctx := context.Background()

    // Check if database is alive.
    err := db.PingContext(ctx)
    if err != nil {
        return -1, err
    }

    tsql := fmt.Sprintf("SELECT Id, Name, Location FROM TestSchema.Employees;")

    // Execute query
    rows, err := db.QueryContext(ctx, tsql)
    if err != nil {
        return -1, err
    }

    defer rows.Close()

    var count int

    // Iterate through the result set.
    for rows.Next() {
        var name, location string
        var id int

        // Get values from row.
        err := rows.Scan(&id, &name, &location)
        if err != nil {
            return -1, err
        }

        fmt.Printf("ID: %d, Name: %s, Location: %s\n", id, name, location)
        count++
    }

    return count, nil
}

// UpdateEmployee updates an employee's information
func UpdateEmployee(name string, location string) (int64, error) {
    ctx := context.Background()

    // Check if database is alive.
    err := db.PingContext(ctx)
    if err != nil {
        return -1, err
    }

    tsql := fmt.Sprintf("UPDATE TestSchema.Employees SET Location = @Location WHERE Name = @Name")

    // Execute non-query with named parameters
    result, err := db.ExecContext(
        ctx,
        tsql,
        sql.Named("Location", location),
        sql.Named("Name", name))
    if err != nil {
        return -1, err
    }

    return result.RowsAffected()
}

// DeleteEmployee deletes an employee from the database
func DeleteEmployee(name string) (int64, error) {
    ctx := context.Background()

    // Check if database is alive.
    err := db.PingContext(ctx)
    if err != nil {
        return -1, err
    }

    tsql := fmt.Sprintf("DELETE FROM TestSchema.Employees WHERE Name = @Name;")

    // Execute non-query with named parameters
    result, err := db.ExecContext(ctx, tsql, sql.Named("Name", name))
    if err != nil {
        return -1, err
    }

    return result.RowsAffected()
}

(8)運行 crud.go 應用以查看結果。

go run crud.go

執(zhí)行結果:

Connected!
Inserted ID: 4 successfully.
ID: 1, Name: Jared, Location: Australia
ID: 2, Name: Nikita, Location: India
ID: 3, Name: Tom, Location: Germany
ID: 4, Name: Jake, Location: United States
Read 4 row(s) successfully.
Updated 1 row(s) successfully.
Deleted 1 row(s) successfully.

2.2、創(chuàng)建一個使用 GORM 連接到 SQL Server 的 Go 應用程序

(1)創(chuàng)建應用目錄并初始化 Go 依賴項。

cd ~/
mkdir SqlServerGormSample
cd SqlServerGormSample

# Get and install the SQL Server driver for Go
go get github.com/denisenkom/go-mssqldb
go install github.com/denisenkom/go-mssqldb

(2)將以下內(nèi)容粘貼到名為orm.go的文件中。確保將密碼變量替換為您自己的變量。

package main

import (
    "fmt"
    "github.com/jinzhu/gorm"
    _ "github.com/jinzhu/gorm/dialects/mssql"
    "log"
)

var server = "localhost"
var port = 1433
var user = "sa"
var password = "你的"
var database = "SampleDB"

// Define a User model struct
type User struct {
    gorm.Model
    FirstName string
    LastName string
}

// Define a Task model struct
type Task struct {
    gorm.Model
    Title string
    DueDate string
    IsComplete bool
    UserID  uint
}

// Read and print all the tasks
func ReadAllTasks(db *gorm.DB){
    var users []User
    var tasks []Task
    db.Find(&users)

    for _, user := range users{
        db.Model(&user).Related(&tasks)
        fmt.Printf("%s %s's tasks:\n", user.FirstName, user.LastName)
        for _, task := range tasks {
            fmt.Printf("Title: %s\nDueDate: %s\nIsComplete:%t\n\n",
                            task.Title, task.DueDate, task.IsComplete)
        }
    }
}

// Update a task based on a user
func UpdateSomeonesTask(db *gorm.DB, userId int){
    var task Task
    db.Where("user_id = ?", userId).First(&task).Update("Title", "Buy donuts for Luis")
    fmt.Printf("Title: %s\nDueDate: %s\nIsComplete:%t\n\n",
                    task.Title, task.DueDate, task.IsComplete)
}

// Delete all the tasks for a user
func DeleteSomeonesTasks(db *gorm.DB, userId int){
    db.Where("user_id = ?", userId).Delete(&Task{})
    fmt.Printf("Deleted all tasks for user %d", userId)
}

func main() {
    connectionString := fmt.Sprintf("server=%s;user id=%s;password=%s;port=%d;database=%s",
                                        server, user, password, port, database)
    db, err := gorm.Open("mssql", connectionString)

    if err != nil {
        log.Fatal("Failed to create connection pool. Error: " + err.Error())
    }
    gorm.DefaultCallback.Create().Remove("mssql:set_identity_insert")
    defer db.Close()

    fmt.Println("Migrating models...")
    db.AutoMigrate(&User{})
    db.AutoMigrate(&Task{})

    // Create awesome Users
    fmt.Println("Creating awesome users...")
    db.Create(&User{FirstName: "Andrea", LastName: "Lam"})      //UserID: 1
    db.Create(&User{FirstName: "Meet", LastName: "Bhagdev"})    //UserID: 2
    db.Create(&User{FirstName: "Luis", LastName: "Bosquez"})    //UserID: 3

    // Create appropriate Tasks for each user
    fmt.Println("Creating new appropriate tasks...")
    db.Create(&Task{
        Title: "Do laundry", DueDate: "2017-03-30", IsComplete: false, UserID: 1})
    db.Create(&Task{
        Title: "Mow the lawn", DueDate: "2017-03-30", IsComplete: false, UserID: 2})
    db.Create(&Task{
        Title: "Do more laundry", DueDate: "2017-03-30", IsComplete: false, UserID: 3})
    db.Create(&Task{
        Title: "Watch TV", DueDate: "2017-03-30", IsComplete: false, UserID: 3})

    // Read
    fmt.Println("\nReading all the tasks...")
    ReadAllTasks(db)

    // Update - update Task title to something more appropriate
    fmt.Println("Updating Andrea's task...")
    UpdateSomeonesTask(db, 1)

    // Delete - delete Luis's task
    DeleteSomeonesTasks(db, 3)
}

(3)運行 orm.go 應用。

go run orm.go

執(zhí)行結果:

[info] removing callback `mssql:set_identity_insert` from C:/Projects/golang-experiments/tutorials/orm.go:70
Migrating models...
Creating awesome users...
Creating new appropriate tasks...

Reading all the tasks...
Andrea Lam's tasks:
Title: Do laundry
DueDate: 2017-03-30
IsComplete:false

Meet Bhagdev's tasks:
Title: Mow the lawn
DueDate: 2017-03-30
IsComplete:false

Luis Bosquez's tasks:
Title: Do more laundry
DueDate: 2017-03-30
IsComplete:false

Title: Watch TV
DueDate: 2017-03-30
IsComplete:false

Updating Andrea's task...
Title: Buy donuts for Luis
DueDate: 2017-03-30
IsComplete:false

Deleted all tasks for user 3

三、讓 Go 應用的速度提高 100 倍

已了解基礎知識,接下來可以了解如何使用 SQL Server 改進應用。通過列存儲索引的簡單示例,以及它們?nèi)绾翁岣邤?shù)據(jù)處理速度。與傳統(tǒng)行存儲索引相比,列存儲索引在分析工作負荷上可實現(xiàn)高達 100 倍的性能,并將數(shù)據(jù)壓縮提高多達 10 倍。

3.1、使用 sqlcmd 創(chuàng)建一個包含 5 萬個的新表

(1)切換到主目錄并為項目創(chuàng)建一個文件夾。

cd ~/
mkdir SqlServerColumnstoreSample
cd SqlServerColumnstoreSample

(2)在 SqlServerColumnstoreSample 文件夾中創(chuàng)建一個名為 CreateSampleTable 的新文件.sql文件。將下面的 T-SQL 代碼粘貼到新的 SQL 文件中。保存并關閉文件。

WITH a AS (SELECT * FROM (VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10)) AS a(a))
SELECT TOP(5000000)
ROW_NUMBER() OVER (ORDER BY a.a) AS OrderItemId
,a.a + b.a + c.a + d.a + e.a + f.a + g.a + h.a AS OrderId
,a.a * 10 AS Price
,CONCAT(a.a, N' ', b.a, N' ', c.a, N' ', d.a, N' ', e.a, N' ', f.a, N' ', g.a, N' ', h.a) AS ProductName
INTO Table_with_5M_rows
FROM a, a AS b, a AS c, a AS d, a AS e, a AS f, a AS g, a AS h;

(3)使用 sqlcmd 連接到數(shù)據(jù)庫并運行 SQL 腳本以創(chuàng)建包含 5 萬行的表。這可能需要幾分鐘才能運行。

sqlcmd -S 127.0.0.1 -U sa -P <你的> -d SampleDB -i ./CreateSampleTable.sql

3.2、創(chuàng)建一個 Go 應用程序,用于查詢此表并測量所花費的時間

(1)在項目文件夾中,初始化 Go 依賴項。

go get github.com/denisenkom/go-mssqldb
go install github.com/denisenkom/go-mssqldb

(2)在您的文件夾中創(chuàng)建一個名為 columnstore.go 的文件。

package main

import (
    _ "github.com/denisenkom/go-mssqldb"
    "database/sql"
    "context"
    "log"
    "fmt"
    "time"
)

var server = "localhost"
var port = 1433
var user = "sa"
var password = "你的"
var database = "SampleDB"

var db *sql.DB

// Delete an employee from database
func ExecuteAggregateStatement(db *sql.DB) {
    ctx := context.Background()

    // Ping database to see if it's still alive.
    // Important for handling network issues and long queries.
    err := db.PingContext(ctx)
    if err != nil {
        log.Fatal("Error pinging database: " + err.Error())
    }

    var result string

    // Execute long non-query to aggregate rows
    err = db.QueryRowContext(ctx, "SELECT SUM(Price) as sum FROM Table_with_5M_rows").Scan(&result)
    if err != nil {
        log.Fatal("Error executing query: " + err.Error())
    }

    fmt.Printf("Sum: %s\n", result)
}

func main() {
    // Connect to database
    connString := fmt.Sprintf("server=%s;user id=%s;password=%s;port=%d;database=%s;",
                                server, user, password, port, database)
    var err error

    // Create connection pool
    db, err = sql.Open("sqlserver", connString)
    if err != nil {
        log.Fatal("Open connection failed:", err.Error())
    }
    fmt.Printf("Connected!\n")

    defer db.Close()

    t1 := time.Now()
    fmt.Printf("Start time: %s\n", t1)

    ExecuteAggregateStatement(db)

    t2 := time.Since(t1)
    fmt.Printf("The query took: %s\n", t2)
}

3.3、測量運行查詢所需的時間

從終端運行 Go 應用。

go run columnstore.go

執(zhí)行結果:

Connected!
Start time: 2023-04-02 15:33:50.0340976 -0700 PDT
Sum: 50000000
The query took: 601.7463ms

3.4、使用 SQLCMD 向表中添加列存儲索引

運行以下命令以在表上創(chuàng)建列存儲索引:

sqlcmd -S localhost -U sa -P <你的> -d SampleDB -Q "CREATE CLUSTERED COLUMNSTORE INDEX Columnstoreindex ON Table_with_5M_rows;"

3.5、重新運行 columnstore.go 腳本,并注意這次完成查詢所花費的時間

go run columnstore.go
Connected!
Start time: 2017-06-05 16:35:02.5409285 -0700 PDT
Sum: 50000000
The query took: 86.9826ms

總結

  1. 使用列存儲索引使 Go 應用更快。
  2. 參考文檔。

在 Ubuntu 使用SQL Server創(chuàng)建 Go 應用程序文章來源地址http://www.zghlxwxcb.cn/news/detail-405643.html

到了這里,關于在 Ubuntu 使用SQL Server創(chuàng)建 Go 應用程序的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • 數(shù)據(jù)庫和區(qū)塊鏈:如何在區(qū)塊鏈應用程序中使用SQL

    作者:禪與計算機程序設計藝術 隨著比特幣的崛起,區(qū)塊鏈技術得到了越來越多的關注。區(qū)塊鏈是一個分布式數(shù)據(jù)庫,它記錄了一個分布式網(wǎng)絡上所有節(jié)點的數(shù)據(jù)狀態(tài)變化過程,讓數(shù)據(jù)具有可信任性、不可篡改性和不可偽造性。目前,國內(nèi)外多個行業(yè)都已經(jīng)開始或正在采用區(qū)

    2024年02月14日
    瀏覽(20)
  • Python 創(chuàng)建 Web 應用程序和用戶界面庫之flexx使用詳解

    Python 創(chuàng)建 Web 應用程序和用戶界面庫之flexx使用詳解

    Flexx 是一個強大的 Python 庫,用于創(chuàng)建交互式的 Web 應用程序和用戶界面。它提供了靈活的組件和布局管理器,使開發(fā)者可以輕松構建具有豐富交互性和動態(tài)性的應用。本文將詳細介紹 Flexx 庫的特性、用法,并通過豐富的示例代碼展示其在實際項目中的應用。 Flexx 是一個基于

    2024年04月17日
    瀏覽(80)
  • TatukGIS Developer Kernel使用教程:如何為FMX創(chuàng)建第一個應用程序

    TatukGIS Developer Kernel使用教程:如何為FMX創(chuàng)建第一個應用程序

    概述: TatukGIS Developer Kernel(DK)是一個用于開發(fā)自定義地理信息系統(tǒng)(GIS)應用程序以及解決方案的綜合性軟件開發(fā)工具包(SDK)。本篇文章主要介紹用DK11為FMX創(chuàng)建一個應用程序,現(xiàn)在就跟著小編來了解一下吧~ # 31款JAVA開發(fā)必備控件和工具?# 界面/文檔管理/報表/IDE等4000款

    2024年02月07日
    瀏覽(23)
  • server服務器報錯_應用程序-特定 權限設置并未向在應用程序容器 不可用 SID (不可用)中運行的地址 LocalHost (使用 LRPC) 中的用戶

    server服務器報錯_應用程序-特定 權限設置并未向在應用程序容器 不可用 SID (不可用)中運行的地址 LocalHost (使用 LRPC) 中的用戶

    server服務器時間報錯日志:應用程序-特定 權限設置并未向在應用程序容器 不可用 SID (不可用)中運行的地址 LocalHost (使用 LRPC) 中的用戶 NT AUTHORITYNETWORK SERVICE SID (S-1-5-20)授予針對 CLSID 為 {46063B1E-BE4A-4014-8755-5B377CD462FC} 、APPID 為 {FAAFC69C-F4ED-4CCA-8849-7B882279EDBE} 的 COM 服務器應用程

    2024年04月16日
    瀏覽(27)
  • python中使用xml快速創(chuàng)建Caption和URL書簽管理器應用程序

    python中使用xml快速創(chuàng)建Caption和URL書簽管理器應用程序

    導語: 本文介紹如何使用wxPython庫創(chuàng)建一個Caption和URL管理器應用程序。該應用程序具有圖形用戶界面,允許用戶輸入Caption和URL,并將其保存到XML文件中。此外,還提供了瀏覽文件夾并選擇HTML文件的功能,并可以運行另一個Python腳本。 C:pythoncodeblogsavexml.py 在軟件開發(fā)中,創(chuàng)

    2024年02月12日
    瀏覽(19)
  • 【Terraform學習】使用 Terraform 創(chuàng)建應用程序負載均衡器(Terraform-AWS最佳實戰(zhàn)學習)

    【Terraform學習】使用 Terraform 創(chuàng)建應用程序負載均衡器(Terraform-AWS最佳實戰(zhàn)學習)

    前提條件 安裝 Terraform :?地址 下載倉庫代碼模版 本實驗代碼 位于? task_elb ?文件夾中 。 變量文件? variables.tf ??? ?? 在上面的代碼中,您將 聲明 , aws_access_key , aws_secret_key 和? 區(qū)域變量 。 terraform.tfvars ?? ?? 在上面的代碼中,您將 定義變量的值 。 main.tf ?? ? ? 在

    2024年02月10日
    瀏覽(28)
  • 為什么選擇Go語言編寫網(wǎng)絡應用程序

    為什么選擇Go語言編寫網(wǎng)絡應用程序

    關注公眾號【愛發(fā)白日夢的后端】分享技術干貨、讀書筆記、開源項目、實戰(zhàn)經(jīng)驗、高效開發(fā)工具等,您的關注將是我的更新動力! 作為一名后端開發(fā)者,你一定對選擇合適的編程語言來編寫網(wǎng)絡應用程序非常重視。在眾多的編程語言中,Go語言(Golang)憑借其獨特的特性和

    2024年02月02日
    瀏覽(21)
  • 怎么創(chuàng)建JDBC應用程序

    建立一個JDBC應用程序,本教程中以Java連接MySQL為一個示例,分六個步驟進行: 1. 導入包 在程序中包含數(shù)據(jù)庫編程所需的JDBC類。大多數(shù)情況下,使用 import java.sql.* 就足夠了,如下所示: 2. 注冊JDBC驅(qū)動程序 需要初始化驅(qū)動程序,這樣就可以打開與數(shù)據(jù)庫的通信。以下是代碼

    2024年02月15日
    瀏覽(37)
  • linux系統(tǒng)(centos、ubuntu、銀河麒麟服務、uos、deepin)判斷程序是否已安裝,通用判斷方法:使用所有應用和命令的判斷

    linux系統(tǒng)(centos、ubuntu、銀河麒麟服務、uos、deepin)判斷程序是否已安裝,通用判斷方法:使用所有應用和命令的判斷

    項目中需要判斷l(xiāng)inux服務器中是否已經(jīng)安裝了某個服務 方法有很多種,但是很多都不通用, 腳本代碼就不容易做成統(tǒng)一的 用下面的腳本代碼去進行判斷 腳本意思如下: 輸入java -version命令,將返回的字符串輸出第一行 如果里面包含java version這個字符串則說明jdk已經(jīng)安裝 ?下

    2024年02月11日
    瀏覽(27)
  • 如何為 Flutter 應用程序創(chuàng)建環(huán)境變量

    如何為 Flutter 應用程序創(chuàng)建環(huán)境變量

    我們?yōu)槭裁葱枰h(huán)境變量? 主要用于存儲高級機密數(shù)據(jù),如果泄露可能會危及您產(chǎn)品的安全性。這些變量本地存儲在每個用戶的本地系統(tǒng)中,不應該簽入存儲庫。每個用戶都有這些變量的副本。 在根項目中創(chuàng)建一個名為 .env 的文件夾(文件夾名稱由您選擇) 在 .gitignore 中添

    2024年02月11日
    瀏覽(21)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包