How to use SQLite ODBC Driver with UTF-8 encoding? - encoding

I downloaded and installed the SQLite ODBC Driver from http://ch-werner.de/sqliteodbc/.
I had three new ODBC Drivers in my List
SQLite (UTF-8) Driver
SQLite ODBC Driver
SQLite3 ODBC Driver
Using the SQLite3 ODBC Driver works just fine. But not with UTF-8.
The SQLite ODBC (UTF-8) Driver which I assumed to work in this case just gives me the error message
Fehler beim Herstellen der Verbindung zur Datenquelle test
IM002 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Fehler beim Herstellen der Verbindung zur Datenquelle: test
English translation:
Error connecting to data source test
IM002 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Error connecting to data source test
What am I doing wrong?

Christian Werner, the provider of the SQLite Driver helped me via E-Mail.
It turned out that in the settings of the SQLite3 ODBC Driver the OEMCP Translation has to be turned on (By clicking Configure... of the specific User DSN in the ODBC Data Source Administrator)
Now all characters are shown as expected.

In connection string, this translates to OEMCPTranslation parameter:
connStr="DRIVER={{SQLite3 ODBC Driver}};Database=<path>;OEMCPTranslation=1";

Today in my case {...} worked, but not {{..}} when coppying tables from the Access database to the SQLite database using VBA:
DoCmd.TransferDatabase acExport, "ODBC Database", _
"ODBC;DRIVER={SQLite3 ODBC Driver};Database=<path>;OEMCPTranslation=1;", _
acTable, <source table>, <destination table>

Related

LUW DB2 JDBC Connection Issue on Open JDK 11

I am not able to connect LUW DB2 database using JDBC Type4 driver on Open Zulu JDK 11.
I have tried all available latest DB2 JDBC Drivers (Type 4) but same issue with all drivers on JDK 11. Things are working fine on JDK 8.
Getting below error
Exception in thread "main" java.lang.NumberFormatException: For input string: "B"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:652)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at com.ibm.db2.jcc.c.xc.<init>(xc.java:64)
at com.ibm.db2.jcc.b.f.<init>(f.java:44)
at com.ibm.db2.jcc.b.b.cb(b.java:1945)
at com.ibm.db2.jcc.c.p.a(p.java:3284)
at com.ibm.db2.jcc.b.b.a(b.java:625)
at com.ibm.db2.jcc.b.b.<init>(b.java:334)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:165)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at com.aonhewitt.Test.main(Test.java:14)
Test Java Code
Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection conn = DriverManager.getConnection("jdbc:db2://hostname:port/database","userid","password");
I would appreciate if anyone can help me here to connect to a DB2-LUW database from JDK 11
C:\>java -cp db2jcc4.jar com.ibm.db2.jcc.DB2Jcc -version
IBM Data Server Driver for JDBC and SQLJ 4.25.23
C:\>java -cp jcc-11.5.4.0.jar com.ibm.db2.jcc.DB2Jcc -version
IBM Data Server Driver for JDBC and SQLJ 4.27.25

db2set codepage in not working in DB2 windows

I am using DB2 version 9.7 and 10.1 both.When i execute the command to change the code page like "db2set db2codepage=1250" it does not show any error. but aftre that when i import the data then it throws the following error
SQLCODE: -332 - SQLSTATE: 57017
*** SQL0332N Character conversion from the source code page "1252" to the target code page "1250" is not supported. SQLSTATE=57017
if the charset is utf-8 you should use DB2CODEPAGE=1208 on non-windows and 1252 on windows in the system and restart your application.

Windows client error for DB2 10.5 fp3 DATA BASE Connection refused:Error:SQL30081N and SQLSTATE IS 08001

When we connect to database we got error in windows client machine.
Error:SQL30081N and SQLSTATE IS 08001.
SERVER:HP-UX DB2 10.5 FP3
Please suggest on this.
A quick Google suggests this may be the result of a firewall blocking the connection: http://www-01.ibm.com/support/docview.wss?uid=swg21503305

Create db2 dataSource in WAS liberty profile

I am developing for Websphere 8.5 (for z/OS), but i would like to use Liberty for local development on my Windows machine. I can't get the data source to work.
I created the following entry in the Server.xml to define the data source.
<library id="DB2JCC2Lib">
<fileset dir="C:\Program Files\IBM\SQLLIB\java"/><!--includes="db2jcc.jar db2jcc_license_cu.jar db2jcc_license_cisuz.jar"-->
</library>
<dataSource id="xxdb" jndiName="jdbc/xxxx" type="javax.sql.ConnectionPoolDataSource">
<jdbcDriver libraryRef="DB2JCC2Lib" id="db2-driver" javax.sql.ConnectionPoolDataSource="com.ibm.db2.jcc.DB2ConnectionPoolDataSource"/>
<properties.db2.jcc driverType="2" databaseName="xxxx" portNumber="50000" user="xxxx" password="{aes}xxxx"/>
</dataSource>
When my application initializes i get the following error message:
[jcc][4038][12241][3.61.65] T2LUW exception: SQL30081N Kommunikationsfehler. Verwendetes Kommunikationsprotokoll: "TCP/IP". Verwendete Kommunikations-API: "SOCKETS". Position, an der der Fehler erkannt wurde: "127.0.0.1". Übertragungsfunktion, die den Fehler festgestellt hat: "connect". Protokollspezifische(r) Fehlercode(s): "10061", "", "". SQLSTATE=08001
I think this message comes from the db2 Driver, unfortunately i didn't find a way yet to change it to english; but i think it's understandable for english speakers.
I have an ODBC System datasource that connects to DB2 v10 maintenance level 015 for z/OS. My local DB2 Connect Installation is v9.7.300.3885.
In my regular Websphere my working datasource has driver type 2, database Name set to the odbc-name and port number 50000. Server name is not set (empty). Classpath and implementation class is the same that i provided in the server.xml
I have tried everything i could find, any ideas?
Note: I can't make changes on the db2 server and there is no issue connecting to the database with other tools and the regular WebSphere.
Also the server name in the websphere configuration is empty, only database name is set. When i tried to set the servername in the server.xml to localhost or the db2 server i got the same result.
Any help is appreciated!
Edit: updated with correct Version Information
Edit 2: As long as it works i dont care what type (2 or 4) of the jdbc driver is used. I just want to point out again that type 2 is currently working on my machine. I tried it with type 4 and got the following message:
[jcc][t4][2043][11550][3.61.65] Exception java.net.ConnectException: Error opening socket to server xxx/xxx.30.3.34 on port 50,000 with message: Connection refused: connect. ERRORCODE=-4499, SQLSTATE=08001 DSRA0010E: SQL State = 08001, Error Code = -4,499
Sorry, previous post ate my xml. Trying again:
You will need a type 4 datasource to connect to a remote database server, i.e.,
<dataSource id="xxdb" jndiName="jdbc/xxxx" type="javax.sql.XADataSource">
<properties.db2.jcc driverType="4" serverName="the.db2.host.com" portNumber="50000" user="xxxx" password="xxxx" databaseName="LOC1" currentSQLID="SYSA"/>
<jdbcDriver libraryRef="DB2JCC2Lib">
</dataSource>
Type 2 is only for a local z/OS connection to a database resource. Your Windows, being remote from z/OS, requires you to use a type 4 connection. Type 4 requires both the serverName and portNumber to be specified. These are not applicable on a type 2 connection.

DB2 9.5 CREATE DATABASE fails with Error SQL0901N, SQLSTATE 58004

Installed DB2 on Windows Vista with Admin priviledges.
Now i cannot create any new databases.. it always fails with the following error:
db2 CREATE DATABASE N3000 AUTOMATIC STORAGE YES ON 'D:\DB2'
DBPATH ON 'D:\DB2'
SQL0901N Die SQL-Anweisung schlug aufgrund eines nicht schwer wiegenden
(nicht kritischen) Systemfehlers fehl. Nachfolgende SQL-Anweisungen können
verarbeitet werden. (Ursachencode: "Length in PD=0, LFD length=1176, DMS
length=1176".) SQLSTATE=58004
Any ideas how to fix this?
in db2 directory:
c:\program files\ibm\sqllib\bin
execute:
db2set DB2_CREATE_DB_ON_PATH=YES
db2stop
db2start
Ready, now you create DB2 Databases in any path!!!!
look this: http://www.db2ude.com/?q=node/54
The problem was caused by an antivirus policy and was unrelated to DB2.
The file "C0000000.CAT" has to be excluded.