簡體   English   中英

在Windows平台上從Node.js連接DB2

[英]Connecting DB2 from Node.js on Windows-platform

我目前正在使用一些jdbc代碼將DB2鏡像到本地MySQL-db。 我想直接從Node.js應用程序連接DB2,而不必查詢鏡像。 我在Windows上運行,我無法更改為Linux。 看來,使用Node.js的DB2上的工作還很少,或者使用了node-odbc(節點的unixODBC綁定)。

我發現這個項目https://github.com/herzi/db2.js為Node提供了DB2綁定,但由於安裝失敗,我無法安裝它。 該軟件包需要Node-gyp(成功安裝)和.NET framework SDK。 我將vcbuild.exe設置為我的PATH。 在這些之后,msbuild.exe抱怨缺少頭文件(sqlcli1.h,sqlsystm.h,sqlca.h),我發現它們是PRO * C的一部分。

我從這里獲取了上面的頭文件: http//files.edin.dk/php/win32/dev/php_build/include/db2/並將它們放入我的Node的src /目錄中。 現在編譯器顯示多個錯誤。

在使用Windows從Node.js應用程序連接DB2而不是嘗試使上述模塊工作時,還有其他選擇嗎?

有人能幫幫我嗎? 安裝上述模塊的步驟是什么?

謝謝!

顯示的錯誤:

C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C2146 : syntax error : missing ';' before identifier 'SQLSTATE' [C:\IS\node\node_modules\db2\build\db2.vcxproj]

C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C2146: syntax error : missing ';' before identifier 'SQLSTATE' [C:\IS\node\node_modules\db2\build\db2.vcxproj]

C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\IS\node\node_modules\db2\build\db2.vcxproj]

C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\IS\node\node_modules\db2\build\db2.vcxproj]

C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\IS\node\node_modules\db2\build\db2.vcxproj]

C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\IS\node\node_modules\db2\build\db2.vcxproj]

C:\Documents and Settings\tpaleniu\.node-gyp\0.8.12\src\sqlcli1.h(1501): error C2371: 'SQLTCHAR' : redefinition; different basic types [C:\IS\node\node_modules\db2\build\db2.vcxproj]

C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30) : see declaration of 'SQLTCHAR'

..\src\connection.cc(77): error C3861: 'snprintf': identifier not found 

[C:\IS\node\node_modules\db2\build\db2.vcxproj]..\src\connection.cc(80): error C3861: 'snprintf': identifier not found [C:\IS\node\node_modules\db2\build\db2.vcxproj]

..\src\connection.cc(111): error C3861: 'bzero': identifier not found [C:\IS\node\node_modules\db2\build\db2.vcxproj]

..\src\connection.cc(208): error C3861: 'bzero': identifier not found [C:\IS\node\node_modules\db2\build\db2.vcxproj]

..\src\connection.cc(547): error C2057: expected constant expression [C:\IS\node\node_modules\db2\build\db2.vcxproj]

..\src\connection.cc(547): error C2466: cannot allocate an array of constant size 0 [C:\IS\node\node_modules\db2\build\db2.vcxproj]

..\src\connection.cc(547): error C2133: 'argv' : unknown size [C:\IS\node\node_modules\db2\build\db2.vcxproj]

確實,node-odbc目前目前僅用於unixODBC。 但Daniel VerWeire目前正致力於在Windows支持node-odbc 我想你需要等一會兒。

Praveen一旦有空,就會在這里發布一個帖子

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM